N-FIN-5: changed success message depending on condition

This commit is contained in:
Markus Thielker 2024-03-10 17:02:32 +01:00
parent e3874add65
commit 4e761d81de
No known key found for this signature in database

View file

@ -35,6 +35,12 @@ export default async function entityCreateUpdate({
},
},
);
// return success
return {
type: 'success',
message: `${type} '${name}' updated`,
};
} else {
await prismaClient.entity.create({
data: {
@ -43,6 +49,12 @@ export default async function entityCreateUpdate({
type: type,
},
});
// return success
return {
type: 'success',
message: `${type} '${name}' created`,
};
}
} catch (e) {
return {
@ -50,10 +62,4 @@ export default async function entityCreateUpdate({
message: 'Failed creating/updating entity',
};
}
// return success
return {
type: 'success',
message: `${type} '${name}' created`,
};
}