generated from fahricansecer/boilerplate-be
This commit is contained in:
@@ -142,11 +142,12 @@ export class ContentController {
|
||||
@ApiOperation({ summary: 'Update content' })
|
||||
async updateContent(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body() dto: { body?: string; status?: ContentStatus; scheduledAt?: string },
|
||||
@Body() dto: { body?: string; status?: ContentStatus; scheduledAt?: string; imageUrl?: string },
|
||||
) {
|
||||
return this.contentService.update(id, {
|
||||
...dto,
|
||||
scheduledAt: dto.scheduledAt ? new Date(dto.scheduledAt) : undefined,
|
||||
imageUrl: dto.imageUrl,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ export class ContentService {
|
||||
/**
|
||||
* Update content
|
||||
*/
|
||||
async update(id: string, data: { body?: string; status?: ContentStatus; scheduledAt?: Date }) {
|
||||
async update(id: string, data: { body?: string; status?: ContentStatus; scheduledAt?: Date; imageUrl?: string }) {
|
||||
return this.prisma.content.update({
|
||||
where: { id },
|
||||
data,
|
||||
|
||||
Reference in New Issue
Block a user