fixed ts errors

This commit is contained in:
2025-10-13 21:42:39 +02:00
parent e0ed8f41bb
commit f918e735a5
2 changed files with 12 additions and 3 deletions

View File

@@ -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();