fixed ts errors
This commit is contained in:
@@ -12,6 +12,9 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
|
||||
return reply.code(400).send({ error: "No tenant selected" });
|
||||
}
|
||||
|
||||
const { id } = req.params as { id: string };
|
||||
|
||||
|
||||
const body = req.body as {
|
||||
email: string
|
||||
password: string
|
||||
@@ -23,7 +26,7 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
|
||||
imap_ssl: boolean
|
||||
};
|
||||
|
||||
if(req.params.id) {
|
||||
if(id) {
|
||||
//SAVE Existing
|
||||
let saveData = {
|
||||
email_encrypted: body.email ? encrypt(body.email) : undefined,
|
||||
@@ -40,7 +43,7 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
|
||||
const { data, error } = await server.supabase
|
||||
.from("user_credentials")
|
||||
.update(saveData)
|
||||
.eq("id", req.params.id)
|
||||
.eq("id", id)
|
||||
.select("*")
|
||||
.single();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user