Merge pull request #625 from TheCoderAdi/fix-issue-614-findOneByForeignId
Some checks are pending
Build and Push Docker API Image / build-and-push (push) Waiting to run
Build and Push Docker Base Image / build-and-push (push) Waiting to run
Build and Push Docker UI Image / build-and-push (push) Waiting to run

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

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;
}
/**