delete/archive implemented

This commit is contained in:
dimitar committed 2026-02-03 23:14:36 +01:00
1 parent 89b8687431
commit 9ca05f5ea1
13 files changed
+680 -163

No files matched your search

@@ -4,6 +4,7 @@ import {
Post,
Put,
Delete,
Patch,
Body,
Param,
Query,
@@ -15,6 +16,7 @@ import {
UpdateArticleDto,
FindArticlesDto,
} from './articles.dto';
import { ArticleStatus } from './entities';
@Controller('articles')
export class ArticlesController {
@@ -54,4 +56,17 @@ export class ArticlesController {
remove(@Param('id') id: string) {
return this.articlesService.remove(id);
}
@Patch(':id/archive')
archive(@Param('id') id: string) {
return this.articlesService.archive(id);
}
@Patch(':id/publish')
publish(
@Param('id') id: string,
@Query('status') status?: ArticleStatus,
) {
return this.articlesService.publish(id, status || ArticleStatus.PUBLISHED);
}
}