Added Cors Hosts
This commit is contained in:
@@ -64,4 +64,45 @@ export default async function userRoutes(server: FastifyInstance) {
|
|||||||
profile,
|
profile,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
server.put("/user/:id/profile", async (req, reply) => {
|
||||||
|
|
||||||
|
const { id } = req.params as { id?: string }
|
||||||
|
|
||||||
|
const { data } = req.body as { data?: object }
|
||||||
|
|
||||||
|
// 4. Profil für den aktiven Tenant laden
|
||||||
|
let profile = null
|
||||||
|
if (req.user.tenant_id) {
|
||||||
|
const { data: profileData } = await server.supabase
|
||||||
|
.from("auth_profiles")
|
||||||
|
.select("*")
|
||||||
|
.eq("user_id", req.user.user_id)
|
||||||
|
.eq("tenant_id", req.user.tenant_id)
|
||||||
|
.single()
|
||||||
|
|
||||||
|
profile = profileData
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(data)
|
||||||
|
|
||||||
|
//Update Profile
|
||||||
|
const { data: updatedProfileData, error: updateError } = await server.supabase
|
||||||
|
.from("auth_profiles")
|
||||||
|
.update(data)
|
||||||
|
.eq("user_id", id)
|
||||||
|
.eq("id", profile?.id)
|
||||||
|
.select("*")
|
||||||
|
.single()
|
||||||
|
|
||||||
|
console.log(updateError)
|
||||||
|
console.log(updatedProfileData)
|
||||||
|
|
||||||
|
// 5. Permissions laden (über Funktion)
|
||||||
|
|
||||||
|
// 6. Response zurückgeben
|
||||||
|
return {
|
||||||
|
data,
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -805,7 +805,7 @@ export const createInvoicePDF = async (server:FastifyInstance, returnMode, invoi
|
|||||||
})
|
})
|
||||||
} else if (invoiceData.taxType === "19 UStG") {
|
} else if (invoiceData.taxType === "19 UStG") {
|
||||||
pages[pageCounter - 1].drawText("Als Kleinunternehmer im Sinne von § 19 Abs. 1 UStG wird keine Umsatzsteuer berechnet.", {
|
pages[pageCounter - 1].drawText("Als Kleinunternehmer im Sinne von § 19 Abs. 1 UStG wird keine Umsatzsteuer berechnet.", {
|
||||||
...getCoordinatesForPDFLib(20, rowHeight + invoiceData.totalArray.length * 8, page1),
|
...getCoordinatesForPDFLib(21, rowHeight + invoiceData.totalArray.length * 8, page1),
|
||||||
size: 10,
|
size: 10,
|
||||||
color: rgb(0, 0, 0),
|
color: rgb(0, 0, 0),
|
||||||
lineHeight: 10,
|
lineHeight: 10,
|
||||||
@@ -814,7 +814,7 @@ export const createInvoicePDF = async (server:FastifyInstance, returnMode, invoi
|
|||||||
})
|
})
|
||||||
} else if (invoiceData.taxType === "12.3 UStG") {
|
} else if (invoiceData.taxType === "12.3 UStG") {
|
||||||
pages[pageCounter - 1].drawText("Umsatzsteuer befreite Lieferung/Leistung für PV-Anlagen gemäß § 12 Absatz 3 UStG.", {
|
pages[pageCounter - 1].drawText("Umsatzsteuer befreite Lieferung/Leistung für PV-Anlagen gemäß § 12 Absatz 3 UStG.", {
|
||||||
...getCoordinatesForPDFLib(20, rowHeight + invoiceData.totalArray.length * 8, page1),
|
...getCoordinatesForPDFLib(21, rowHeight + invoiceData.totalArray.length * 8, page1),
|
||||||
size: 10,
|
size: 10,
|
||||||
color: rgb(0, 0, 0),
|
color: rgb(0, 0, 0),
|
||||||
lineHeight: 10,
|
lineHeight: 10,
|
||||||
|
|||||||
Reference in New Issue
Block a user