back port some changes from postgres

This commit is contained in:
Ben
2023-12-23 19:30:05 -05:00
parent 8f6eeaba73
commit 38fda85f63
7 changed files with 55 additions and 33 deletions
@@ -14,9 +14,9 @@ export class AddressSettingsService {
}
public async getSettings(address: string) {
public async getSettings(address: string, createIfNotFound: boolean) {
const settings = await this.addressSettingsRepository.findOne({ where: { address } });
if (settings == null) {
if (createIfNotFound == true && settings == null) {
return await this.createNew(address);
}
return settings;