mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
database: Unify work and recording API
This commit is contained in:
parent
c93ebf17a0
commit
0fc0c933ac
7 changed files with 116 additions and 201 deletions
|
|
@ -19,9 +19,9 @@ class RecordingsController extends ResourceController {
|
|||
@Operation.put('id')
|
||||
Future<Response> putRecording(
|
||||
@Bind.path('id') int id, @Bind.body() Map<String, dynamic> json) async {
|
||||
final data = RecordingData.fromJson(json);
|
||||
await db.updateRecording(data);
|
||||
final recordingInfo = RecordingInfo.fromJson(json);
|
||||
await db.updateRecording(recordingInfo);
|
||||
|
||||
return Response.ok(await db.getRecording(id));
|
||||
return Response.ok(null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ class WorksController extends ResourceController {
|
|||
@Operation.put('id')
|
||||
Future<Response> putWork(
|
||||
@Bind.path('id') int id, @Bind.body() Map<String, dynamic> json) async {
|
||||
final data = WorkData.fromJson(json);
|
||||
await db.updateWork(data);
|
||||
|
||||
return Response.ok(await db.getWork(id));
|
||||
final workInfo = WorkInfo.fromJson(json);
|
||||
await db.updateWork(workInfo);
|
||||
|
||||
return Response.ok(null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue