Add api for pinned resources

This commit is contained in:
2025-08-28 10:38:55 +08:00
parent f3b3f2bd5a
commit 77ad261670
4 changed files with 71 additions and 4 deletions

View File

@@ -48,7 +48,13 @@ func setServerConfig(c fiber.Ctx) error {
return model.NewRequestError("Invalid request parameters")
}
config.SetConfig(sc)
if err := config.SetConfig(sc); err != nil {
return model.NewInternalServerError("Failed to save configuration")
}
if err := sc.Validate(); err != nil {
return model.NewRequestError(err.Error())
}
return c.JSON(model.Response[any]{
Success: true,