mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:24:54 +00:00
Some checks are pending
Deploy image by kubeconfig / build-fastgpt-docs-images (push) Waiting to run
Deploy image by kubeconfig / update-docs-image (push) Blocked by required conditions
Deploy image to vercel / deploy-production (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
* app folder * feat: app foldere * fix: run app param error * perf: select app ux * perf: folder rerender * fix: ts * fix: parentId * fix: permission * perf: loading ux * perf: per select ux * perf: clb context * perf: query extension tip * fix: ts * perf: app detail per * perf: default per
18 lines
354 B
TypeScript
18 lines
354 B
TypeScript
import { ParentIdType } from './type';
|
|
|
|
export const parseParentIdInMongo = (parentId: ParentIdType) => {
|
|
if (parentId === undefined) return {};
|
|
|
|
if (parentId === null || parentId === '')
|
|
return {
|
|
parentId: null
|
|
};
|
|
|
|
const pattern = /^[0-9a-fA-F]{24}$/;
|
|
if (pattern.test(parentId))
|
|
return {
|
|
parentId
|
|
};
|
|
return {};
|
|
};
|