mirror of
https://github.com/immich-app/immich.git
synced 2026-03-01 18:19:10 +03:00
refactor: api key spec to use factories (#16776)
This commit is contained in:
@@ -12,7 +12,7 @@ export class ApiKeyRepository {
|
||||
constructor(@InjectKysely() private db: Kysely<DB>) {}
|
||||
|
||||
create(dto: Insertable<ApiKeys>) {
|
||||
return this.db.insertInto('api_keys').values(dto).returningAll().executeTakeFirstOrThrow();
|
||||
return this.db.insertInto('api_keys').values(dto).returning(columns.apiKey).executeTakeFirstOrThrow();
|
||||
}
|
||||
|
||||
async update(userId: string, id: string, dto: Updateable<ApiKeys>) {
|
||||
@@ -21,7 +21,7 @@ export class ApiKeyRepository {
|
||||
.set(dto)
|
||||
.where('api_keys.userId', '=', userId)
|
||||
.where('id', '=', asUuid(id))
|
||||
.returningAll()
|
||||
.returning(columns.apiKey)
|
||||
.executeTakeFirstOrThrow();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user