feat: add GET endpoint for sync/all for easier testing

This commit is contained in:
echo 2026-02-28 16:33:27 +01:00
parent 94b0239a0a
commit 8fbde18d02

View File

@ -1,4 +1,4 @@
import { Controller, Post, Body, Logger } from '@nestjs/common';
import { Controller, Post, Get, Body, Logger } from '@nestjs/common';
import { StrapiService } from './strapi.service';
import { Public } from './auth/public.decorator';
@ -120,11 +120,19 @@ export class StrapiController {
}
@Post('sync/all')
@Public()
async syncAllArticles() {
await this.strapiService.syncArticles();
return { message: 'Articles sync completed' };
}
@Get('sync/all')
@Public()
async syncAllArticlesGet() {
await this.strapiService.syncArticles();
return { message: 'Articles sync completed' };
}
@Post('sync/live-blogs')
async syncAllLiveBlogs() {
await this.strapiService.syncLiveBlogs();