bug fixes file deletions and more

This commit is contained in:
Zoe
2024-09-09 01:35:33 -05:00
parent 86ef860568
commit 70a9bcd904
14 changed files with 325 additions and 51 deletions

View File

@@ -136,5 +136,13 @@ func GetUser(c echo.Context) error {
return c.JSON(http.StatusNotFound, map[string]string{"message": "User not found"})
}
basePath := fmt.Sprintf("%s/%s/", os.Getenv("STORAGE_PATH"), user.(*models.User).ID)
storageUsage, err := calculateStorageUsage(basePath)
if err != nil {
return err
}
user.(*models.User).Usage = storageUsage
return c.JSON(http.StatusOK, user.(*models.User))
}