reformat with prettier with semicolons and tabs
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import { resolver } from "blitz"
|
||||
import { resolver } from "blitz";
|
||||
|
||||
import db from "db"
|
||||
import getCurrentCustomer from "../../customers/queries/get-current-customer"
|
||||
import db from "db";
|
||||
import getCurrentCustomer from "../../customers/queries/get-current-customer";
|
||||
|
||||
export default resolver.pipe(resolver.authorize(), async (_ = null, context) => {
|
||||
const customer = await getCurrentCustomer(null, context)
|
||||
const customer = await getCurrentCustomer(null, context);
|
||||
return db.phoneNumber.findFirst({
|
||||
where: { customerId: customer!.id },
|
||||
select: {
|
||||
@ -12,5 +12,5 @@ export default resolver.pipe(resolver.authorize(), async (_ = null, context) =>
|
||||
phoneNumber: true,
|
||||
phoneNumberSid: true,
|
||||
},
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { resolver } from "blitz"
|
||||
import db from "db"
|
||||
import { z } from "zod"
|
||||
import { resolver } from "blitz";
|
||||
import db from "db";
|
||||
import { z } from "zod";
|
||||
|
||||
const GetCustomerPhoneNumber = z.object({
|
||||
// This accepts type of undefined, but is required at runtime
|
||||
customerId: z.string().optional().refine(Boolean, "Required"),
|
||||
})
|
||||
});
|
||||
|
||||
export default resolver.pipe(resolver.zod(GetCustomerPhoneNumber), async ({ customerId }) =>
|
||||
db.phoneNumber.findFirst({
|
||||
@ -16,4 +16,4 @@ export default resolver.pipe(resolver.zod(GetCustomerPhoneNumber), async ({ cust
|
||||
phoneNumberSid: true,
|
||||
},
|
||||
})
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user