Skip to content

Commit

Permalink
fix: location simpleSchemas validator
Browse files Browse the repository at this point in the history
Signed-off-by: vanpho93 <[email protected]>
  • Loading branch information
vanpho93 committed Mar 20, 2023
1 parent ac5df58 commit c0903c7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
30 changes: 25 additions & 5 deletions packages/api-plugin-location/src/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ type LocationAddress {
city: String!

" The State/Province/Region of the address."
region: String!
region: String

" The ZIP/Postal Code of the address."
postal: String!
postal: String

" The ISO 3166-1 alpha-2 country code of the address."
country: String!
Expand Down Expand Up @@ -138,10 +138,10 @@ input LocationAddressInput {
city: String!

" The State/Province/Region of the address."
region: String!
region: String

" The ZIP/Postal Code of the address."
postal: String!
postal: String

" The ISO 3166-1 alpha-2 country code of the address."
country: String!
Expand Down Expand Up @@ -186,6 +186,26 @@ input LocationCreateInput {
enabled: Boolean
}

input LocationUpdateAddressInput {
" The first line of the address."
address1: String

" The second line of the address."
address2: String

" The city of the address."
city: String

" The State/Province/Region of the address."
region: String

" The ZIP/Postal Code of the address."
postal: String

" The ISO 3166-1 alpha-2 country code of the address."
country: String
}

input LocationUpdateInput {
" The location ID"
_id: ID!
Expand All @@ -203,7 +223,7 @@ input LocationUpdateInput {
type: String

" The address of the location."
address: LocationAddressInput
address: LocationUpdateAddressInput

" The phone number of the location."
phoneNumber: String
Expand Down
3 changes: 2 additions & 1 deletion packages/api-plugin-location/src/simpleSchemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const LocationAddress = new SimpleSchema({
},
region: {
label: "State/Province/Region",
type: String
type: String,
optional: true
},
postal: {
label: "ZIP/Postal Code",
Expand Down

0 comments on commit c0903c7

Please sign in to comment.