mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 10:11:10 +00:00
Changes callApiPutAsync to return a success flag alongside the response data
This commit is contained in:
1 parent
d78e553fe2
commit
95be37602a
3 files changed
+8
-7
No files matched your search
@@ -103,10 +103,10 @@
|
||||
|
||||
const isRoleSelected = formData.roleId !== '';
|
||||
|
||||
const data = isRoleSelected ?
|
||||
const result = isRoleSelected ?
|
||||
await callApiPutAsync('@_urlService.GetAbsoluteUrl("UpdateRole", "Admin")', formData) :
|
||||
await callApiPostAsync('@_urlService.GetAbsoluteUrl("CreateRole", "Admin")', formData);
|
||||
if (data) {
|
||||
{ success: (await callApiPostAsync('@_urlService.GetAbsoluteUrl("CreateRole", "Admin")', formData)) !== undefined };
|
||||
if (result.success) {
|
||||
await fetchRolesAsync();
|
||||
notificationService.show(isRoleSelected ? '@_localizer["RoleUpdated"]' : '@_localizer["RoleCreated"]', NotificationType.SUCCESS);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user