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:
Hugo Häggmark
2021-09-10 11:22:13 +02:00
committed by GitHub
parent 580b03c952
commit fc73bc1161
9 changed files with 224 additions and 6 deletions
+6
View File
@@ -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)
}