feat: initial integration of cert template management

This commit is contained in:
Sheen Capadngan
2024-08-15 21:06:37 +08:00
parent 05efd95472
commit 28a2a6c41a
14 changed files with 595 additions and 3 deletions
@@ -476,7 +476,11 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
CertificateTemplatesSchema.pick({
id: true,
name: true
})
}).merge(
z.object({
caName: z.string()
})
)
)
})
}
@@ -16,7 +16,8 @@ export const certificateTemplateDALFactory = (db: TDbClient) => {
`${TableName.CertificateTemplate}.caId`
)
.where(`${TableName.CertificateAuthority}.projectId`, "=", projectId)
.select(selectAllTableCols(TableName.CertificateTemplate));
.select(selectAllTableCols(TableName.CertificateTemplate))
.select(db.ref("friendlyName").as("caName").withSchema(TableName.CertificateAuthority));
return certTemplates;
};