MCPcopy
hub / github.com/directus/directus / createOne

Method createOne

api/src/services/flows.ts:12–23  ·  view source on GitHub ↗
(data: Partial<Item>, opts?: MutationOptions)

Source from the content-addressed store, hash-verified

10 }
11
12 override async createOne(data: Partial<Item>, opts?: MutationOptions): Promise<PrimaryKey> {
13 if (!('status' in data) || data['status'] === 'active') {
14 await getEntitlementManager().assert('flows', { adding: 1, knex: this.knex });
15 }
16
17 const result = await super.createOne(data, opts);
18
19 await getEntitlementManager().clearCache('flows');
20 await getFlowManager().reload();
21
22 return result;
23 }
24
25 override async updateMany(keys: PrimaryKey[], data: Partial<Item>, opts?: MutationOptions): Promise<PrimaryKey[]> {
26 if ('status' in data && data['status'] === 'active') {

Callers 1

handlerFunction · 0.95

Calls 6

getEntitlementManagerFunction · 0.85
getFlowManagerFunction · 0.85
assertMethod · 0.80
createOneMethod · 0.65
clearCacheMethod · 0.65
reloadMethod · 0.45

Tested by

no test coverage detected