diff --git a/apps/game/server/contacts/contacts.database.ts b/apps/game/server/contacts/contacts.database.ts index e76d68075..e45e4b6a0 100644 --- a/apps/game/server/contacts/contacts.database.ts +++ b/apps/game/server/contacts/contacts.database.ts @@ -4,11 +4,16 @@ import { DbInterface } from '@npwd/database'; import { config } from '@npwd/config/server'; export class _ContactsDB { + private readonly defaultContacts: Contact[] = config.defaultContacts.map((contact) => ({ + id: `${contact.display}:${contact.number}`, + ...contact, + })); + async fetchAllContacts(identifier: string): Promise { const query = 'SELECT * FROM npwd_phone_contacts WHERE identifier = ? ORDER BY display ASC'; const [results] = await DbInterface._rawExec(query, [identifier]); - return config.defaultContacts.concat(results); + return this.defaultContacts.concat(results); } async addContact(