mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
test: Add unit test for projects/app/src/pages/api/core/dataset/paths.ts (#4349)
* Add unit tests for the getParents function in the dataset paths API. * Update paths.ts --------- Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com> Co-authored-by: Archer <545436317@qq.com>
This commit is contained in:
@@ -25,7 +25,7 @@ async function handler(req: NextApiRequest) {
|
||||
return await getParents(type === 'current' ? dataset._id : dataset.parentId);
|
||||
}
|
||||
|
||||
async function getParents(parentId?: string): Promise<ParentTreePathItemType[]> {
|
||||
export async function getParents(parentId?: string): Promise<ParentTreePathItemType[]> {
|
||||
if (!parentId) {
|
||||
return [];
|
||||
}
|
||||
|
Reference in New Issue
Block a user