[Emails migration] Fix email field migration (#7065)

Fix email field migration

- Remove deprecated field of type Email
- Add standard emails field on person to person views in position 4
This commit is contained in:
Marie
2024-09-16 19:35:13 +02:00
committed by GitHub
parent b0c9b9ebe2
commit dcac832616
4 changed files with 192 additions and 0 deletions

View File

@ -98,4 +98,26 @@ export class ViewService {
);
}
}
async getViewsIdsForObjectMetadataId({
workspaceId,
objectMetadataId,
}: {
workspaceId: string;
objectMetadataId: string;
}) {
const viewRepository =
await this.twentyORMGlobalManager.getRepositoryForWorkspace(
workspaceId,
'view',
);
return viewRepository
.find({
where: {
objectMetadataId: objectMetadataId,
},
})
.then((views) => views.map((view) => view.id));
}
}