mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-11 13:19:48 +02:00
Better sync log
This commit is contained in:
@@ -71,7 +71,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
//TODO Path check
|
||||
library.BasePath = newBasePath;
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
//TODO Name check
|
||||
library.LibraryName = newName;
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
@@ -113,10 +113,10 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
public async Task<Results<Created<string>, InternalServerError<string>>> CreateNewLibrary ([FromBody]CreateLibraryRecord requestData)
|
||||
{
|
||||
//TODO Parameter check
|
||||
Schema.MangaContext.FileLibrary library = new Schema.MangaContext.FileLibrary(requestData.BasePath, requestData.LibraryName);
|
||||
Schema.MangaContext.FileLibrary library = new (requestData.BasePath, requestData.LibraryName);
|
||||
context.FileLibraries.Add(library);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
|
||||
return TypedResults.Created(string.Empty, library.Key);
|
||||
@@ -140,7 +140,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
|
||||
context.FileLibraries.Remove(library);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
Reference in New Issue
Block a user