refactor script checking in CollectionSettings and FolderSettings

This commit is contained in:
Pragadesh-45 2024-11-04 14:57:03 +05:30
parent 22bc1d4ac5
commit e025ed8436
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ const CollectionSettings = ({ collection }) => {
};
const root = collection?.root;
const hasScripts = root?.request?.script.res || root?.request?.script.req;
const hasScripts = root?.request?.script?.res || root?.request?.script?.req;
const hasTests = root?.request?.tests;
const hasDocs = root?.docs;

View File

@ -26,7 +26,7 @@ const FolderSettings = ({ collection, folder }) => {
}
const folderRoot = collection?.items.find((item) => item.uid === folder?.uid)?.root;
const hasScripts = folderRoot?.request?.script.res || folderRoot?.request?.script.req;
const hasScripts = folderRoot?.request?.script?.res || folderRoot?.request?.script?.req;
const hasTests = folderRoot?.request?.tests;
const headers = folderRoot?.request?.headers || [];