fix: Remove unnecessary sql.NullString conversion for storage space name
This commit is contained in:
parent
9d2f8e27c5
commit
86ee4f2ecb
1 changed files with 1 additions and 8 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue