MCPcopy
hub / github.com/directus/directus / setOwner

Method setOwner

api/src/services/settings.ts:98–116  ·  view source on GitHub ↗
(data: OwnerInformation)

Source from the content-addressed store, hash-verified

96 }
97
98 async setOwner(data: OwnerInformation) {
99 const { project_id } = await this.knex.select('project_id').from('directus_settings').first();
100
101 const primaryKey = await this.upsertSingleton({
102 project_owner: data.project_owner,
103 product_updates: data.product_updates,
104 project_usage: data.project_usage,
105 org_name: data.org_name,
106 });
107
108 sendReport({ ...data, project_id, version }).catch(async () => {
109 await this.knex
110 .update('project_status', 'pending')
111 .from('directus_settings')
112 .catch(() => {});
113 });
114
115 return primaryKey;
116 }
117}

Callers 4

upFunction · 0.95
bootstrapFunction · 0.95
settings.tsFile · 0.80
server.tsFile · 0.80

Calls 4

sendReportFunction · 0.85
fromMethod · 0.80
upsertSingletonMethod · 0.65
updateMethod · 0.45

Tested by

no test coverage detected