From c0903c75d7f172b9c9d90ff0523e89fa5af8f121 Mon Sep 17 00:00:00 2001 From: vanpho93 Date: Mon, 20 Mar 2023 09:20:34 +0700 Subject: [PATCH] fix: location simpleSchemas validator Signed-off-by: vanpho93 --- .../src/schemas/schema.graphql | 30 +++++++++++++++---- .../api-plugin-location/src/simpleSchemas.js | 3 +- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/packages/api-plugin-location/src/schemas/schema.graphql b/packages/api-plugin-location/src/schemas/schema.graphql index 5ce5d6dd1e..4fd8c2ce7c 100644 --- a/packages/api-plugin-location/src/schemas/schema.graphql +++ b/packages/api-plugin-location/src/schemas/schema.graphql @@ -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! @@ -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! @@ -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! @@ -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 diff --git a/packages/api-plugin-location/src/simpleSchemas.js b/packages/api-plugin-location/src/simpleSchemas.js index 8a90c98be1..623f5c535f 100644 --- a/packages/api-plugin-location/src/simpleSchemas.js +++ b/packages/api-plugin-location/src/simpleSchemas.js @@ -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",