Resolve issue with file visibility not updating after caching user files

This commit is contained in:
2024-09-23 10:44:25 +07:00
parent 9452d48bbd
commit 1feeafe7de
7 changed files with 50 additions and 62 deletions

View File

@ -36,7 +36,14 @@ func PATCH(w http.ResponseWriter, r *http.Request) {
return
}
userFile, err := app.Server.Service.GetUserFile(r.Context(), newFile.Name, newFile.OwnerID.String())
err = app.Server.Service.DeleteFileCache(r.Context(), fileID)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
app.Server.Logger.Error(err.Error())
return
}
userFile, err := app.Server.Service.GetUserFile(r.Context(), newFile.ID)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
app.Server.Logger.Error(err.Error())