Skip to content

Commit

Permalink
Add ability to move content between tenants
Browse files Browse the repository at this point in the history
  • Loading branch information
imsitnikov committed Nov 9, 2023
1 parent d7f4d09 commit 6a569aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/components/error-response-presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,15 @@ export default (error: AppError | DBError) => {
},
};
}
case US_ERRORS.MOVE_TENANT_CONTENT_DENIED: {
return {
code: 403,
response: {
code,
message: message ?? 'Move tenant content denied',
},
};
}
default:
return {
code: 500,
Expand Down
1 change: 1 addition & 0 deletions src/const/us-error-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const US_ERRORS = {
ENTRY_IS_NOT_IN_WORKBOOK: 'ENTRY_IS_NOT_IN_WORKBOOK',
UNKNOWN_OPERATION_TYPE: 'UNKNOWN_OPERATION_TYPE',
IAM_OPERATION_NOT_EXISTS: 'IAM_OPERATION_NOT_EXISTS',
MOVE_TENANT_CONTENT_DENIED: 'MOVE_TENANT_CONTENT_DENIED',
};

export const ERROR_BY_DLS_STATUS_CODE: {[key: number]: string} = {
Expand Down
2 changes: 1 addition & 1 deletion src/services/entry/actions/copy-to-workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const copyToWorkbook = async (ctx: CTX, params: Params) => {

logInfo(ctx, 'COPY_ENTRY_TO_WORKBOOK_CALL', {
entryIds: entryIds.map((entryId) => Utils.encodeId(entryId)),
destinationWorkbookId,
destinationWorkbookId: Utils.encodeId(destinationWorkbookId),
tenantIdOverride,
});

Expand Down

0 comments on commit 6a569aa

Please sign in to comment.