Bug fixes

This commit is contained in:
Sean Edmunds
2025-07-01 15:54:59 -05:00
parent a6b98c409a
commit 5982e1add5
12 changed files with 628 additions and 432 deletions

View File

@@ -60,7 +60,7 @@ export function useMutationAPI() {
</Text>
),
autoClose: false,
withCloseButton: false,
withCloseButton: true,
icon: <VscLoading size={24} />,
});
const options: { method: string; headers: HeadersInit | undefined; body: string } = {
@@ -73,44 +73,40 @@ export function useMutationAPI() {
const responseData = await response.json();
if (typeof responseData === 'object') {
if (responseData.error.code === 'ER_DUP_ENTRY') {
setTimeout(() => {
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Failure!
</Text>
),
message: (
<Text c={'var(--mantine-color-primary-0)'}>
Entry with that name already exists.
</Text>
),
autoClose: 2500,
icon: <FaCheck size={24} />,
});
}, 2500);
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Failure!
</Text>
),
message: (
<Text c={'var(--mantine-color-primary-0)'}>
Entry with that name already exists.
</Text>
),
autoClose: 2500,
icon: <FaCheck size={24} />,
});
}
}
return await responseData;
}
setTimeout(() => {
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Success!
</Text>
),
message: (
<Text c={'var(--mantine-color-primary-0)'}>Called endpoint {endpoint}</Text>
),
autoClose: 2500,
icon: <FaCheck size={24} />,
});
}, 2500);
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Success!
</Text>
),
message: (
<Text c={'var(--mantine-color-primary-0)'}>Called endpoint {endpoint}</Text>
),
autoClose: 2500,
icon: <FaCheck size={24} />,
});
return await response.json();
};
@@ -249,42 +245,38 @@ export function useFileUploadAPI() {
const responseData = await response.json();
if (typeof responseData === 'object') {
if (responseData.error.code === 'ER_DUP_ENTRY') {
setTimeout(() => {
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Failure!
</Text>
),
message: (
<Text c={'var(--mantine-color-primary-0)'}>
Entry with that name already exists.
</Text>
),
autoClose: 2500,
icon: <FaCheck size={24} />,
});
}, 2500);
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Failure!
</Text>
),
message: (
<Text c={'var(--mantine-color-primary-0)'}>
Entry with that name already exists.
</Text>
),
autoClose: 2500,
icon: <FaCheck size={24} />,
});
}
}
return await responseData;
}
setTimeout(() => {
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Success!
</Text>
),
message: <Text c={'var(--mantine-color-primary-0)'}>{response.statusText}</Text>,
autoClose: 2500,
icon: <FaCheck size={24} />,
});
}, 2500);
notifications.update({
id: id,
loading: false,
title: (
<Text fw={600} c={'var(--mantine-color-accent-0)'}>
{method} Success!
</Text>
),
message: <Text c={'var(--mantine-color-primary-0)'}>{response.statusText}</Text>,
autoClose: 2500,
icon: <FaCheck size={24} />,
});
return await response.json();
};