Made it so a corporate user is not able to generate more code than they are allowed to
This commit is contained in:
@@ -63,12 +63,12 @@ export default function BatchCodeGenerator({user}: {user: User}) {
|
||||
}
|
||||
|
||||
if (status === 403) {
|
||||
toast.error(`You do not have permission to generate ${capitalize(type)} codes!`, {toastId: "forbidden"});
|
||||
toast.error(data.reason, {toastId: "forbidden"});
|
||||
}
|
||||
})
|
||||
.catch(({response: {status}}) => {
|
||||
.catch(({response: {status, data}}) => {
|
||||
if (status === 403) {
|
||||
toast.error(`You do not have permission to generate ${capitalize(type)} codes!`, {toastId: "forbidden"});
|
||||
toast.error(data.reason, {toastId: "forbidden"});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ export default function CodeGenerator({user}: {user: User}) {
|
||||
}
|
||||
|
||||
if (status === 403) {
|
||||
toast.error(`You do not have permission to generate a ${capitalize(type)} code!`, {toastId: "forbidden"});
|
||||
toast.error(data.reason, {toastId: "forbidden"});
|
||||
}
|
||||
})
|
||||
.catch(({response: {status}}) => {
|
||||
.catch(({response: {status, data}}) => {
|
||||
if (status === 403) {
|
||||
toast.error(`You do not have permission to generate a ${capitalize(type)} code!`, {toastId: "forbidden"});
|
||||
toast.error(data.reason, {toastId: "forbidden"});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user