mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Update PATCH /projects/:projectId/folders/:folderId endpoint to allow moving folder (no-changelog) (#13574)
This commit is contained in:
@@ -5,9 +5,11 @@ import {
|
||||
UpdateFolderDto,
|
||||
} from '@n8n/api-types';
|
||||
import { Response } from 'express';
|
||||
import { UserError } from 'n8n-workflow';
|
||||
|
||||
import { Post, RestController, ProjectScope, Body, Get, Patch, Delete, Query } from '@/decorators';
|
||||
import { FolderNotFoundError } from '@/errors/folder-not-found.error';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
import { InternalServerError } from '@/errors/response-errors/internal-server.error';
|
||||
import { NotFoundError } from '@/errors/response-errors/not-found.error';
|
||||
import type { ListQuery } from '@/requests';
|
||||
@@ -69,6 +71,8 @@ export class ProjectController {
|
||||
} catch (e) {
|
||||
if (e instanceof FolderNotFoundError) {
|
||||
throw new NotFoundError(e.message);
|
||||
} else if (e instanceof UserError) {
|
||||
throw new BadRequestError(e.message);
|
||||
}
|
||||
throw new InternalServerError(undefined, e);
|
||||
}
|
||||
@@ -79,7 +83,7 @@ export class ProjectController {
|
||||
async deleteFolder(
|
||||
req: AuthenticatedRequest<{ projectId: string; folderId: string }>,
|
||||
_res: Response,
|
||||
@Body payload: DeleteFolderDto,
|
||||
@Query payload: DeleteFolderDto,
|
||||
) {
|
||||
const { projectId, folderId } = req.params;
|
||||
|
||||
@@ -88,6 +92,8 @@ export class ProjectController {
|
||||
} catch (e) {
|
||||
if (e instanceof FolderNotFoundError) {
|
||||
throw new NotFoundError(e.message);
|
||||
} else if (e instanceof UserError) {
|
||||
throw new BadRequestError(e.message);
|
||||
}
|
||||
throw new InternalServerError(undefined, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user