feat: add cabinet management functionality

This commit is contained in:
Tran Anh Tuan
2026-05-08 15:26:31 +07:00
parent 459ff6b384
commit 58cfe890a1
14 changed files with 1981 additions and 856 deletions

View File

@@ -141,6 +141,7 @@ func RoomUpdate(c *gin.Context) error {
existing.UpdatedAt = time.Now()
room, err := repositories.UpdateRoom(c.Request.Context(), global.Queries, existing)
if err != nil {
log.Error().Err(err).Msgf("Failed to update room with ID: %d", id)
response.InternalServerError(c, http.StatusInternalServerError, "Failed to update room")
return nil
}
@@ -173,6 +174,7 @@ func RoomDelete(c *gin.Context) error {
}
err = repositories.DeleteRoom(c.Request.Context(), global.Queries, id)
if err != nil {
log.Error().Err(err).Msgf("Failed to delete room with ID: %d", id)
response.InternalServerError(c, http.StatusInternalServerError, "Failed to delete room")
return nil
}