MCPcopy
hub / github.com/directus/directus / processField

Method processField

api/src/services/payload.ts:335–361  ·  view source on GitHub ↗
(
		field: SchemaOverview['collections'][string]['fields'][string],
		payload: Partial<Item>,
		action: PayloadAction,
		accountability: Accountability | null,
	)

Source from the content-addressed store, hash-verified

333 }
334
335 async processField(
336 field: SchemaOverview['collections'][string]['fields'][string],
337 payload: Partial<Item>,
338 action: PayloadAction,
339 accountability: Accountability | null,
340 ): Promise<any> {
341 if (!field.special) return payload[field.field];
342 const fieldSpecials = field.special ? toArray(field.special) : [];
343
344 let value = clone(payload[field.field]);
345
346 for (const special of fieldSpecials) {
347 if (special in this.transformers) {
348 value = await this.transformers[special]!({
349 action,
350 value,
351 payload,
352 accountability,
353 specials: fieldSpecials,
354 helpers: this.helpers,
355 overwriteDefaults: this.overwriteDefaults,
356 });
357 }
358 }
359
360 return value;
361 }
362
363 /**
364 * Native geometries are stored in custom binary format. We need to insert them with

Callers 2

processValuesMethod · 0.95
processAggregatesMethod · 0.95

Calls 1

toArrayFunction · 0.90

Tested by

no test coverage detected