Skip to content

Commit

Permalink
feat(api+admin): certification registry manager of a given certificat…
Browse files Browse the repository at this point in the history
…ion can now delete a competence bloc
  • Loading branch information
agarbe committed Dec 6, 2024
1 parent a649bc9 commit fc56590
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ const updateCertificationCompetenceBlocMutation = graphql(`

const deleteCertificationCompetenceBlocMutation = graphql(`
mutation deleteCertificationCompetenceBlocForUpdateCompetenceBlocPage(
$certificationCompetenceBlocId: String!
$certificationId: ID!
$certificationCompetenceBlocId: ID!
) {
referential_deleteCertificationCompetenceBloc(
certificationId: $certificationId
certificationCompetenceBlocId: $certificationCompetenceBlocId
) {
id
Expand Down Expand Up @@ -90,6 +92,7 @@ export const useUpdateCompetenceBlocPage = ({
const deleteCertificationCompetenceBloc = useMutation({
mutationFn: () =>
graphqlClient.request(deleteCertificationCompetenceBlocMutation, {
certificationId: competenceBloc?.certification.id || "",
certificationCompetenceBlocId,
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ const updateCertificationCompetenceBlocMutation = graphql(`

const deleteCertificationCompetenceBlocMutation = graphql(`
mutation deleteCertificationCompetenceBlocForCertificationRegistryManagerUpdateCompetenceBlocPage(
$certificationCompetenceBlocId: String!
$certificationId: ID!
$certificationCompetenceBlocId: ID!
) {
referential_deleteCertificationCompetenceBloc(
certificationId: $certificationId
certificationCompetenceBlocId: $certificationCompetenceBlocId
) {
id
Expand Down Expand Up @@ -90,6 +92,7 @@ export const useUpdateCompetenceBlocPage = ({
const deleteCertificationCompetenceBloc = useMutation({
mutationFn: () =>
graphqlClient.request(deleteCertificationCompetenceBlocMutation, {
certificationId: competenceBloc?.certification.id || "",
certificationCompetenceBlocId,
}),
});
Expand Down
3 changes: 2 additions & 1 deletion packages/reva-api/modules/referential/referential.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ type Mutation {
input: UpdateCompetenceBlocInput!
): CertificationCompetenceBloc
referential_deleteCertificationCompetenceBloc(
certificationCompetenceBlocId: String!
certificationId: ID!
certificationCompetenceBlocId: ID!
): CertificationCompetenceBloc!
referential_addCertification(input: AddCertificationInput!): Certification!
referential_updateCertificationStructureAndCertificationAuthorities(
Expand Down
5 changes: 2 additions & 3 deletions packages/reva-api/modules/referential/referential.security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ export const referentialResolversSecurityMap = {
"Mutation.referential_updateCertificationCompetenceBloc":
isAdminOrCertificationRegistryManagerOfCertification,
"Mutation.referential_addCertification": [hasRole(["admin"])],
"Mutation.referential_deleteCertificationCompetenceBloc": [
hasRole(["admin"]),
],
"Mutation.referential_deleteCertificationCompetenceBloc":
isAdminOrCertificationRegistryManagerOfCertification,
"Mutation.referential_updateCertificationStructureAndCertificationAuthorities":
[hasRole(["admin"])],
"Mutation.referential_sendCertificationToRegistryManager": [
Expand Down

0 comments on commit fc56590

Please sign in to comment.