Browse Source

Custom currency deleted

pull/4354/head
csehatt741 6 months ago
committed by Attila Cseh
parent
commit
2b1dc62930
  1. 16
      apps/api/src/app/admin/admin.service.ts

16
apps/api/src/app/admin/admin.service.ts

@ -110,6 +110,7 @@ export class AdminService {
}: AssetProfileIdentifier) {
await this.marketDataService.deleteMany({ dataSource, symbol });
await this.symbolProfileService.delete({ dataSource, symbol });
await this.deleteCustomCurrency(symbol);
}
public async get(): Promise<AdminData> {
@ -776,4 +777,19 @@ export class AdminService {
}
);
}
private async deleteCustomCurrency(symbol: string) {
const currency = getCurrencyFromSymbol(symbol);
const customCurrencies = (await this.propertyService.getByKey(
PROPERTY_CURRENCIES
)) as string[];
const updatedCustomCurrencies = customCurrencies.filter(
(aCurrency) => aCurrency !== currency
);
await this.propertyService.put({
key: PROPERTY_CURRENCIES,
value: JSON.stringify(updatedCustomCurrencies)
});
}
}

Loading…
Cancel
Save