This commit is contained in:
Timothy Jaeryang Baek
2025-01-29 21:56:28 -08:00
parent 33fffd6b1d
commit d6c82939e6
9 changed files with 19 additions and 22 deletions

View File

@@ -31,7 +31,7 @@
description,
accessControl
).catch((e) => {
toast.error(e);
toast.error(`${e}`);
});
if (res) {
@@ -112,10 +112,7 @@
<div class="mt-2">
<div class="px-3 py-2 bg-gray-50 dark:bg-gray-950 rounded-lg">
<AccessControl
bind:accessControl
accessRoles={['read', 'write']}
/>
<AccessControl bind:accessControl accessRoles={['read', 'write']} />
</div>
</div>

View File

@@ -149,7 +149,7 @@
try {
const uploadedFile = await uploadFile(localStorage.token, file).catch((e) => {
toast.error(e);
toast.error(`${e}`);
return null;
});
@@ -169,7 +169,7 @@
toast.error($i18n.t('Failed to upload file.'));
}
} catch (e) {
toast.error(e);
toast.error(`${e}`);
}
};
@@ -339,7 +339,7 @@
const syncDirectoryHandler = async () => {
if ((knowledge?.files ?? []).length > 0) {
const res = await resetKnowledgeById(localStorage.token, id).catch((e) => {
toast.error(e);
toast.error(`${e}`);
});
if (res) {
@@ -357,7 +357,7 @@
const addFileHandler = async (fileId) => {
const updatedKnowledge = await addFileToKnowledgeById(localStorage.token, id, fileId).catch(
(e) => {
toast.error(e);
toast.error(`${e}`);
return null;
}
);
@@ -386,7 +386,7 @@
}
} catch (e) {
console.error('Error in deleteFileHandler:', e);
toast.error(e);
toast.error(`${e}`);
}
};
@@ -395,7 +395,7 @@
const content = selectedFile.data.content;
const res = updateFileDataContentById(localStorage.token, fileId, content).catch((e) => {
toast.error(e);
toast.error(`${e}`);
});
const updatedKnowledge = await updateFileFromKnowledgeById(
@@ -403,7 +403,7 @@
id,
fileId
).catch((e) => {
toast.error(e);
toast.error(`${e}`);
});
if (res && updatedKnowledge) {
@@ -430,7 +430,7 @@
description: knowledge.description,
access_control: knowledge.access_control
}).catch((e) => {
toast.error(e);
toast.error(`${e}`);
});
if (res) {
@@ -522,7 +522,7 @@
id = $page.params.id;
const res = await getKnowledgeById(localStorage.token, id).catch((e) => {
toast.error(e);
toast.error(`${e}`);
return null;
});