Don't filter for group contract ids
This commit is contained in:
parent
abde013ab6
commit
56a579ff91
|
@ -14,18 +14,11 @@ const addGroupIdToContracts = async () => {
|
||||||
const groups = await getValues<Group>(adminFirestore.collection('groups'))
|
const groups = await getValues<Group>(adminFirestore.collection('groups'))
|
||||||
|
|
||||||
for (const group of groups) {
|
for (const group of groups) {
|
||||||
const contracts = await getValues<Contract>(
|
const groupContracts = await getValues<Contract>(
|
||||||
adminFirestore
|
adminFirestore
|
||||||
.collection('contracts')
|
.collection('contracts')
|
||||||
.where('groupSlugs', 'array-contains', group.slug)
|
.where('groupSlugs', 'array-contains', group.slug)
|
||||||
)
|
)
|
||||||
const groupContracts = contracts.filter((contract) =>
|
|
||||||
group.contractIds.includes(contract.id)
|
|
||||||
)
|
|
||||||
if (groupContracts.length !== contracts.length)
|
|
||||||
console.log(
|
|
||||||
`Found ${groupContracts.length} contracts for group ${group.slug}`
|
|
||||||
)
|
|
||||||
|
|
||||||
for (const contract of groupContracts) {
|
for (const contract of groupContracts) {
|
||||||
const oldGroupLinks = contract.groupLinks?.filter(
|
const oldGroupLinks = contract.groupLinks?.filter(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user