I just want to call a service function to fullfill a variable but idk if this is the best way to do it.
constructor(private sessionService: SessionService,
private api: ApiService,) {
this.getCurrencies();
}
private async getCurrencies(): Promise<Currencies[]> {
try {
const r = await this.api.get<Currencies[]>('/v1/configuration/currencies');
if (r.success) {
this._currencies = r.data;
return r.data;
}
throw (r.message);
} catch (err) {
throw (err);
}
}