Improve requested user/host validation for ssh certificate template

This commit is contained in:
Tuan Dang
2024-12-03 23:22:04 -08:00
parent 00ce755996
commit 8edfa9ad0b
2 changed files with 54 additions and 18 deletions
@@ -130,7 +130,7 @@ export const sshCertificateTemplateServiceFactory = ({
if (name) {
const existingTemplate = await sshCertificateTemplateDAL.getByName(name, actorOrgId);
if (existingTemplate) {
if (existingTemplate && existingTemplate.id !== id) {
throw new BadRequestError({
message: `SSH certificate template with name ${name} already exists`
});