Skip to content

Commit 7845670

Browse files
committed
Fix organizations update
1 parent 5e82450 commit 7845670

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

frontend/src/modules/organization/components/form/organization-form-identities.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ function findPlatform(platform) {
172172
function onInputChange(newValue, key, value, index) {
173173
model.value.identities[index] = {
174174
...props.modelValue.identities[index],
175+
name: newValue,
175176
url: newValue.length ? `https://${value.urlPrefix}${newValue}` : null,
176177
};
177178
}

frontend/src/modules/organization/pages/organization-form-page.vue

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,17 @@ function getInitialModel(record) {
204204
return JSON.parse(
205205
JSON.stringify(
206206
formSchema.initialValues({
207+
...(record || {}),
207208
name: record ? record.name : '',
208209
displayName: record ? record.displayName || record.name : '',
209210
headline: record ? record.headline : '',
210211
description: record ? record.description : '',
211212
joinedAt: record ? record.joinedAt : '',
212-
employees: record ? record.employees : null,
213-
location: record ? record.location : null,
214-
website: record ? record.website : null,
215213
identities: record ? [...record.identities.map((i) => ({
214+
...i,
216215
platform: i.platform,
217216
name: i.name,
218-
username: i.url ? i.url.split('/').at(-1) : '',
217+
username: i.url ? i.url.split('/').at(-1) : null,
219218
url: i.url,
220219
}))] : [],
221220
revenueRange: record ? record.revenueRange : {},
@@ -227,29 +226,6 @@ function getInitialModel(record) {
227226
record && record.phoneNumbers?.length > 0
228227
? record.phoneNumbers
229228
: [''],
230-
type: record ? record.type : null,
231-
size: record ? record.size : null,
232-
industry: record ? record.industry : null,
233-
founded: record ? record.founded : null,
234-
profiles: record ? record.profiles : null,
235-
affiliatedProfiles: record ? record.affiliatedProfiles : null,
236-
allSubsidiaries: record ? record.allSubsidiaries : null,
237-
alternativeDomains: record ? record.alternativeDomains : null,
238-
alternativeNames: record ? record.alternativeNames : null,
239-
averageEmployeeTenure: record ? record.averageEmployeeTenure : null,
240-
averageTenureByLevel: record ? record.averageTenureByLevel : null,
241-
averageTenureByRole: record ? record.averageTenureByRole : null,
242-
directSubsidiaries: record ? record.directSubsidiaries : null,
243-
employeeChurnRate: record ? record.employeeChurnRate : null,
244-
employeeCountByCountry: record ? record.employeeCountByCountry : null,
245-
employeeCountByMonth: record ? record.employeeCountByMonth : null,
246-
employeeGrowthRate: record ? record.employeeGrowthRate : null,
247-
gicsSector: record ? record.gicsSector : null,
248-
grossAdditionsByMonth: record ? record.grossAdditionsByMonth : null,
249-
grossDeparturesByMonth: record ? record.grossDeparturesByMonth : null,
250-
immediateParent: record ? record.immediateParent : null,
251-
tags: record ? record.tags : null,
252-
ultimateParent: record ? record.ultimateParent : null,
253229
}),
254230
),
255231
);
@@ -377,6 +353,7 @@ function onCancel() {
377353
378354
async function onSubmit() {
379355
isFormSubmitting.value = true;
356+
380357
const data = {
381358
manuallyCreated: true,
382359
...formModel.value,
@@ -388,7 +365,8 @@ async function onSubmit() {
388365
}
389366
return acc;
390367
}, []),
391-
identities: formModel.value.identities.filter((i) => i.username.length > 0).map((i) => ({
368+
identities: formModel.value.identities.filter((i) => i.username?.length > 0 || i.organizationId).map((i) => ({
369+
...i,
392370
platform: i.platform,
393371
url: i.url,
394372
name: i.name,

0 commit comments

Comments
 (0)