mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Do not parse json in transform operation if it is already an object (#15354)
Fixes #14814
This commit is contained in:
committed by
GitHub
parent
f5befa5bc5
commit
38fb314950
@@ -1,13 +1,13 @@
|
||||
import { defineOperationApi, parseJSON } from '@directus/shared/utils';
|
||||
import { defineOperationApi, optionToObject } from '@directus/shared/utils';
|
||||
|
||||
type Options = {
|
||||
json: string;
|
||||
json: string | Record<string, any>;
|
||||
};
|
||||
|
||||
export default defineOperationApi<Options>({
|
||||
id: 'transform',
|
||||
|
||||
handler: ({ json }) => {
|
||||
return parseJSON(json);
|
||||
return optionToObject(json);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user