1
0
mirror of https://github.com/hexastack/hexabot synced 2025-04-24 16:27:23 +00:00

Merge pull request from TheCoderAdi/fix-issue-614-findOneByForeignId

fix: update return type of findOneByForeignId to include null
This commit is contained in:
Med Marrouchi 2025-01-28 06:42:49 +01:00 committed by GitHub
commit 6c5c43027d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,12 +123,12 @@ export class SubscriberRepository extends BaseRepository<
*
* @param id - The foreign ID of the subscriber.
*
* @returns The found subscriber entity.
* @returns The found subscriber entity, or `null` if no subscriber is found.
*/
async findOneByForeignId(id: string): Promise<Subscriber> {
async findOneByForeignId(id: string): Promise<Subscriber | null> {
const query = this.findByForeignIdQuery(id);
const [result] = await this.execute(query, Subscriber);
return result;
return result || null;
}
/**