Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ codeunit 30198 "Shpfy Sync Shop Locations"
if not ShopLocation.FindFirst() then
exit;

if ShopLocation."Fulfillment Service Id" = 0 then
if ShopLocation."Fulfillment Service Id" = 0 then begin
GetFulfillmentService(ShopLocation);
if ShopLocation."Fulfillment Service Id" = 0 then
exit;
end;

if ShopLocation."Fulfillment Srv. Callback Url" = GetFulfillmentServiceCallbackUrl() then
exit;
Expand All @@ -148,13 +151,19 @@ codeunit 30198 "Shpfy Sync Shop Locations"
GraphQLType: Enum "Shpfy GraphQL Type";
Parameters: Dictionary of [Text, Text];
JResponse: JsonToken;
JLocation: JsonObject;
JFulfillmentService: JsonObject;
begin
GraphQLType := "Shpfy GraphQL Type"::GetLocation;
Parameters.Add('Id', Format(ShopLocation.Id));
JResponse := CommunicationMgt.ExecuteGraphQL(GraphQLType, Parameters);

if not JsonHelper.GetJsonObject(JResponse, JFulfillmentService, 'data.location.fulfillmentService') then
if not JsonHelper.GetJsonObject(JResponse, JLocation, 'data.location') then begin
ShopLocation.Delete(true);
exit;
end;

if not JsonHelper.GetJsonObject(JLocation.AsToken(), JFulfillmentService, 'fulfillmentService') then
exit;

ShopLocation."Fulfillment Service Id" := CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JFulfillmentService, 'id'));
Expand Down
Loading