diff options
author | crupest <crupest@outlook.com> | 2020-07-31 23:13:03 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-31 23:13:03 +0800 |
commit | 9014a5b52e9810eb71bc88b3645b0e716a8576ca (patch) | |
tree | a1a8cdb46a3f1b2770c7a1c310de1a64cada4c8a /Timeline/ClientApp/src/app/http/common.ts | |
parent | da0ba10c5f28b494f93b28956ccb96a4d6bd3b94 (diff) | |
download | timeline-9014a5b52e9810eb71bc88b3645b0e716a8576ca.tar.gz timeline-9014a5b52e9810eb71bc88b3645b0e716a8576ca.tar.bz2 timeline-9014a5b52e9810eb71bc88b3645b0e716a8576ca.zip |
Add http get timeline api query params.
Diffstat (limited to 'Timeline/ClientApp/src/app/http/common.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/http/common.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/http/common.ts b/Timeline/ClientApp/src/app/http/common.ts index 8fb8eb69..3c2f2ba6 100644 --- a/Timeline/ClientApp/src/app/http/common.ts +++ b/Timeline/ClientApp/src/app/http/common.ts @@ -119,6 +119,16 @@ export function convertToNetworkError( }
}
+export function extractDataOrConvert304ToNotModified<T>(
+ res: AxiosResponse<T>
+): T | NotModified {
+ if (res.status === 304) {
+ return new NotModified();
+ } else {
+ return res.data;
+ }
+}
+
export function convertToBlobWithEtag(res: AxiosResponse<Blob>): BlobWithEtag {
return {
data: res.data,
|