mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 11:12:16 +01:00
improve error handling for 401 requests and fetch
This commit is contained in:
@@ -13,11 +13,12 @@ export const useMembersStore = defineStore('members', () => {
|
||||
const organization = getCurrentOrganizationId();
|
||||
if (organization) {
|
||||
membersResponse.value = await handleApiRequestNotifications(
|
||||
api.getMembers({
|
||||
params: {
|
||||
organization: organization,
|
||||
},
|
||||
}),
|
||||
() =>
|
||||
api.getMembers({
|
||||
params: {
|
||||
organization: organization,
|
||||
},
|
||||
}),
|
||||
undefined,
|
||||
'Failed to fetch members'
|
||||
);
|
||||
@@ -28,15 +29,16 @@ export const useMembersStore = defineStore('members', () => {
|
||||
const organization = getCurrentOrganizationId();
|
||||
if (organization) {
|
||||
await handleApiRequestNotifications(
|
||||
api.removeMember(
|
||||
{},
|
||||
{
|
||||
params: {
|
||||
organization: organization,
|
||||
member: membershipId,
|
||||
},
|
||||
}
|
||||
),
|
||||
() =>
|
||||
api.removeMember(
|
||||
{},
|
||||
{
|
||||
params: {
|
||||
organization: organization,
|
||||
member: membershipId,
|
||||
},
|
||||
}
|
||||
),
|
||||
'Member deleted successfully',
|
||||
'Failed to delete member'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user