Fix offer update notification for AAD users (#338)

This commit is contained in:
Steve Faulkner
2020-12-11 13:38:57 -06:00
committed by GitHub
parent c21f42159f
commit ea39c1d092
12 changed files with 33 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
import { Offer, SDKOfferDefinition } from "../Contracts/DataModels";
import { OfferResponse } from "@azure/cosmos";
import { HttpHeaders } from "./Constants";
export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer => {
const offerDefinition: SDKOfferDefinition = offerResponse?.resource;
@@ -18,7 +19,7 @@ export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer => {
manualThroughput: undefined,
minimumThroughput,
offerDefinition,
headers: offerResponse.headers
offerReplacePending: offerResponse.headers?.[HttpHeaders.offerReplacePending] === "true"
};
}
@@ -28,6 +29,6 @@ export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer => {
manualThroughput: offerContent.offerThroughput,
minimumThroughput,
offerDefinition,
headers: offerResponse.headers
offerReplacePending: offerResponse.headers?.[HttpHeaders.offerReplacePending] === "true"
};
};