feat(api.dossier.modifier_annotation): stop validation only with graphql schema, also validate with our validations methods
This commit is contained in:
parent
8e6c5d1567
commit
e63b777bd9
2 changed files with 12 additions and 1 deletions
|
@ -20,7 +20,7 @@ module Mutations
|
|||
annotation.value = value
|
||||
end
|
||||
|
||||
if annotation.save
|
||||
if annotation.validate(:champs_private_value) && annotation.save
|
||||
{ annotation: }
|
||||
else
|
||||
{ errors: annotation.errors.full_messages }
|
||||
|
|
|
@ -1476,6 +1476,17 @@ describe API::V2::GraphqlController do
|
|||
})
|
||||
end
|
||||
end
|
||||
context "failure" do
|
||||
let(:value) { drop_down_list_options.first.reverse }
|
||||
it 'should be a success' do
|
||||
expect(gql_errors).to eq(nil)
|
||||
|
||||
expect(gql_data).to eq(dossierModifierAnnotationDropDownList: {
|
||||
annotation: nil,
|
||||
errors: [{ message: "doit être dans les options proposées" }]
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'integer_number' do
|
||||
|
|
Loading…
Reference in a new issue