fix: Remove unnecessary sql.NullString conversion for storage space name

This commit is contained in:
garionion (aider) 2025-02-28 22:17:29 +01:00
parent 9d2f8e27c5
commit 86ee4f2ecb

View file

@ -236,18 +236,11 @@ func (h *StorageHandler) CreateStorageSpace(c echo.Context) error {
location.String = req.Location location.String = req.Location
} }
// Convert name to sql.NullString
var name sql.NullString
if req.Name != "" {
name.Valid = true
name.String = req.Name
}
// Create storage space // Create storage space
err := h.db.CreateStorageSpace(ctx, db.CreateStorageSpaceParams{ err := h.db.CreateStorageSpace(ctx, db.CreateStorageSpaceParams{
Parent: parent, Parent: parent,
Location: location, Location: location,
Name: name, Name: req.Name,
}) })
if err != nil { if err != nil {