feat(contents): add updateAdmin method to contents service

- Introduced `updateAdmin` logic to handle admin-specific content updates.
- Included cache clearing upon successful update for data consistency.
This commit is contained in:
Mathis HERRIOT
2026-01-21 13:19:08 +01:00
parent 07cdb741b3
commit 3a5550d6eb

View File

@@ -184,6 +184,16 @@ export class ContentsService {
return deleted;
}
async updateAdmin(id: string, data: any) {
this.logger.log(`Updating content ${id} by admin`);
const updated = await this.contentsRepository.update(id, data);
if (updated) {
await this.clearContentsCache();
}
return updated;
}
async findOne(idOrSlug: string, userId?: string) {
const content = await this.contentsRepository.findOne(idOrSlug, userId);
if (!content) return null;