move / check into separat feature ("root")

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-11-16 00:27:00 +01:00
parent ce980390df
commit 4587901672
3 changed files with 30 additions and 13 deletions

View File

@@ -10,12 +10,12 @@ part 'poster.service.g.dart';
@injectable
class PosterService {
@Route.get('/')
Future<Response> listPosters(Request request) async {
Future<Response> getRoot(Request request) async {
return Response.ok('deprecated poster endpoint. use POST /poster instead');
}
@Route.post('/')
Future<Response> createPoster(Request request) async {
Future<Response> postRoot(Request request) async {
final payload = await request.readAsString();
final body = jsonDecode(payload);
final params = posterSchema.safeParse(body);
@@ -32,6 +32,5 @@ class PosterService {
return Response.ok(jsonEncode(params.data), headers: {'Content-Type': 'application/json'});
}
// Create router using the generate function defined in 'poster.g.dart'.
Router get router => _$PosterServiceRouter(this);
}