refactor: count all return type (#17529)

This commit is contained in:
Jason Rasmussen
2025-04-10 14:38:49 -04:00
committed by GitHub
parent abde0fbe60
commit 0b22d3348e
9 changed files with 52 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { getName } from 'i18n-iso-countries';
import { Expression, Insertable, Kysely, sql, SqlBool } from 'kysely';
import { Expression, Insertable, Kysely, NotNull, sql, SqlBool } from 'kysely';
import { InjectKysely } from 'nestjs-kysely';
import { createReadStream, existsSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
@@ -87,6 +87,7 @@ export class MapRepository {
.on('exif.longitude', 'is not', null),
)
.select(['id', 'exif.latitude as lat', 'exif.longitude as lon', 'exif.city', 'exif.state', 'exif.country'])
.$narrowType<{ lat: NotNull; lon: NotNull }>()
.where('isVisible', '=', true)
.$if(isArchived !== undefined, (q) => q.where('isArchived', '=', isArchived!))
.$if(isFavorite !== undefined, (q) => q.where('isFavorite', '=', isFavorite!))
@@ -114,7 +115,7 @@ export class MapRepository {
return eb.or(expression);
})
.orderBy('fileCreatedAt', 'desc')
.execute() as Promise<MapMarker[]>;
.execute();
}
async reverseGeocode(point: GeoPoint): Promise<ReverseGeocodeResult> {