remove change on api V1 and update graphql for sensitive data
This commit is contained in:
parent
f34c890278
commit
3953470c78
4 changed files with 7 additions and 14 deletions
|
@ -2085,6 +2085,7 @@ type TextChamp implements Champ {
|
||||||
}
|
}
|
||||||
|
|
||||||
type TitreIdentiteChamp implements Champ {
|
type TitreIdentiteChamp implements Champ {
|
||||||
|
filled: Boolean!
|
||||||
grantType: TitreIdentiteGrantType!
|
grantType: TitreIdentiteGrantType!
|
||||||
id: ID!
|
id: ID!
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,14 @@ module Types::Champs
|
||||||
end
|
end
|
||||||
|
|
||||||
field :grant_type, TitreIdentiteGrantTypeType, null: false
|
field :grant_type, TitreIdentiteGrantTypeType, null: false
|
||||||
|
field :filled, Boolean, null: false
|
||||||
|
|
||||||
def grant_type
|
def grant_type
|
||||||
TypesDeChamp::TitreIdentiteTypeDeChamp::PIECE_JUSTIFICATIVE
|
TypesDeChamp::TitreIdentiteTypeDeChamp::PIECE_JUSTIFICATIVE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filled
|
||||||
|
object.piece_justificative_file.attached?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,6 +41,6 @@ class Champs::TitreIdentiteChamp < Champ
|
||||||
end
|
end
|
||||||
|
|
||||||
def for_api
|
def for_api
|
||||||
piece_justificative_file.attached? ? "présent" : "absent"
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,17 +11,4 @@ describe Champs::TitreIdentiteChamp do
|
||||||
it { is_expected.to eq('absent') }
|
it { is_expected.to eq('absent') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#for_api' do
|
|
||||||
let(:champ_titre_identite) { create(:champ_titre_identite) }
|
|
||||||
|
|
||||||
subject { champ_titre_identite.for_api }
|
|
||||||
|
|
||||||
it { is_expected.to eq('présent') }
|
|
||||||
|
|
||||||
context 'without attached file' do
|
|
||||||
before { champ_titre_identite.piece_justificative_file.purge }
|
|
||||||
it { is_expected.to eq('absent') }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue