Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
♻️ Update group ID as attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Sep 8, 2020
1 parent b83ac2b commit 629b7aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/_staart/rest/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,14 @@ export const updateGroupBillingForUser = async (
result = await createCustomer(
groupId,
data,
(groupId: number, data: groupsUpdateInput) =>
prisma.groups.update({ where: { id: groupId }, data })
async (groupId: number, data: { stripeCustomerId: string }) => {
const attributes =
typeof group.attributes === "object" ? group.attributes : {};
return prisma.groups.update({
where: { id: groupId },
data: { attributes: { ...attributes, ...data } },
});
}
);
}
queueWebhook(groupId, Webhooks.UPDATE_ORGANIZATION_BILLING, data);
Expand Down

0 comments on commit 629b7aa

Please sign in to comment.