|
|
@ -501,11 +501,13 @@ export const offersProfileRouter = createRouter()
|
|
|
|
const profileEditToken = profileToDelete?.editToken;
|
|
|
|
const profileEditToken = profileToDelete?.editToken;
|
|
|
|
|
|
|
|
|
|
|
|
if (profileEditToken === input.token) {
|
|
|
|
if (profileEditToken === input.token) {
|
|
|
|
return await ctx.prisma.offersProfile.delete({
|
|
|
|
const deletedProfile = await ctx.prisma.offersProfile.delete({
|
|
|
|
where: {
|
|
|
|
where: {
|
|
|
|
id: input.profileId,
|
|
|
|
id: input.profileId,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return deletedProfile.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO: Throw 401
|
|
|
|
// TODO: Throw 401
|
|
|
|
throw new trpc.TRPCError({
|
|
|
|
throw new trpc.TRPCError({
|
|
|
|