LibraryElements: Enables creating library elements with specific UID (#39019)
* LibraryPanels: Enables create/update library panels with specific UID * Chore: added check for uid length after PR comments * Refactor: creates IsShortUIDTooLong function * Refactor: adds UID to PATCH endpoint * Refactor: clarifies the patch code * Refactor: changes after PR comments
This commit is contained in:
@@ -125,5 +125,11 @@ func toLibraryElementError(err error, message string) response.Response {
|
||||
if errors.Is(err, errLibraryElementHasConnections) {
|
||||
return response.Error(403, errLibraryElementHasConnections.Error(), err)
|
||||
}
|
||||
if errors.Is(err, errLibraryElementInvalidUID) {
|
||||
return response.Error(400, errLibraryElementInvalidUID.Error(), err)
|
||||
}
|
||||
if errors.Is(err, errLibraryElementUIDTooLong) {
|
||||
return response.Error(400, errLibraryElementUIDTooLong.Error(), err)
|
||||
}
|
||||
return response.Error(500, message, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user