Ensure credential objects come oldest first (#1258)

Given the credentials are loaded based on userId, sort is not consistent.
Without this, events are booked on whichever calendar credential is loaded first. 
813eaa83b7/lib/events/EventManager.ts (L240-L244)

Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
This commit is contained in:
Rory Hughes 2021-12-06 13:25:22 +00:00 committed by GitHub
parent dc13c95644
commit c109ab1e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
},
select: {
id: true,
credentials: true,
credentials: {
orderBy: { id: "desc" as Prisma.SortOrder },
},
timeZone: true,
email: true,
name: true,