Added fetching for Shop Region + OPCODE decoding.

This commit is contained in:
Patrick Fic
2020-01-30 17:19:07 -08:00
parent b7c8aef9e5
commit fc52804362
5 changed files with 96 additions and 23 deletions

View File

@@ -66,6 +66,7 @@ namespace BodyshopUploader.Utils
try
{
Thread.Sleep(1000);//Allow a small amount of time to pass before processing the queue item so that any writes can finish.
await GetOpCodes();
DecodeQueueItemJob(item);
await UpsertQueueItem(item);
}
@@ -77,6 +78,26 @@ namespace BodyshopUploader.Utils
}
}
}
private static async Task GetOpCodes()
{
var r = new GraphQLRequest
{
Query = @"query MyQuery($key: String!) {
masterdata(where: {key: {_eq: $key}}) {
value
key
}
}",
Variables = new
{
key = "CA_BC_ciecaopcodes"
}
};
var data = await Utils.GraphQL.ExecuteQuery(r);
Utils.AppMetaData.CiecaOpCodes = JObject.Parse(data.masterdata[0].value.Value);
}
private static void DecodeQueueItemJob(DTO_QueueItem item)
{