feat: add cabinet management functionality
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user