feat(contents): add updateAdmin endpoint and repository method

- Introduced `PATCH /:id/admin` endpoint to update admin-specific content.
- Added `update` method to `ContentsRepository` for data updates with timestamp.
This commit is contained in:
Mathis HERRIOT
2026-01-21 13:18:41 +01:00
parent 02796e4e1f
commit 07cdb741b3
2 changed files with 17 additions and 0 deletions

View File

@@ -404,6 +404,15 @@ export class ContentsRepository {
return deleted;
}
async update(id: string, data: Partial<typeof contents.$inferInsert>) {
const [updated] = await this.databaseService.db
.update(contents)
.set({ ...data, updatedAt: new Date() })
.where(eq(contents.id, id))
.returning();
return updated;
}
async findBySlug(slug: string) {
const [result] = await this.databaseService.db
.select()