use nullable for field updates

This commit is contained in:
nkanaev
2026-05-11 10:27:50 +01:00
parent 450f64605e
commit 31274d17a5
6 changed files with 28 additions and 22 deletions

View File

@@ -292,10 +292,11 @@ func (s *Server) handleFeed(c *router.Context) {
}
}
if f_id, ok := body["folder_id"]; ok {
params.UpdateFolderID = true
if reflect.TypeOf(f_id).Kind() == reflect.Float64 {
if f_id == nil {
params.FolderID = storage.SetNullable[int64](nil)
} else if reflect.TypeOf(f_id).Kind() == reflect.Float64 {
folderId := int64(f_id.(float64))
params.FolderID = &folderId
params.FolderID = storage.SetNullable(&folderId)
}
}
if link, ok := body["feed_link"]; ok {