-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Elliot Yibaebi
committed
Feb 18, 2025
1 parent
63e9244
commit 6acaeb6
Showing
397 changed files
with
12,717 additions
and
8,141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import CommonDRFAdapter from './commondrf'; | ||
|
||
export default class SkAddToInventoryAdapter extends CommonDRFAdapter { | ||
_buildURL() { | ||
const baseurl = `${this.namespace_v2}/sk_app`; | ||
|
||
return this.buildURLFromBase(baseurl); | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-add-to-inventory': SkAddToInventoryAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import commondrf from './commondrf'; | ||
import type { InitiateUploadResponse } from './sk-app'; | ||
|
||
export type SkAppVersionQuery = { | ||
sk_app_id?: string | number; | ||
is_latest?: boolean; | ||
}; | ||
|
||
export default class SkAppVersionAdapter extends commondrf { | ||
_buildURL(_: string, id: string | number) { | ||
const baseurl = `${this.namespace_v2}/sk_app_versions`; | ||
|
||
if (id) { | ||
return this.buildURLFromBase(`${baseurl}/${encodeURIComponent(id)}`); | ||
} | ||
|
||
return this.buildURLFromBase(baseurl); | ||
} | ||
|
||
_buildNestedURL(_: string | number, skAppId: string | number) { | ||
const baseURL = `${this.namespace_v2}/sk_app/${skAppId}/sk_app_version`; | ||
|
||
return this.buildURLFromBase(baseURL); | ||
} | ||
|
||
urlForQuery<K extends string | number>( | ||
query: SkAppVersionQuery, | ||
modelName: K | ||
) { | ||
if (query.sk_app_id) { | ||
const skAppId = query.sk_app_id; | ||
|
||
delete query.sk_app_id; | ||
|
||
return this._buildNestedURL(modelName, skAppId); | ||
} | ||
|
||
return super.urlForQuery(query, modelName); | ||
} | ||
|
||
async initiateAppUpload(id: string) { | ||
const url = this.buildURL().concat(`/${id}/sk_initiate_upload`); | ||
|
||
return (await this.ajax(url, 'POST')) as InitiateUploadResponse; | ||
} | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'sk-app-version': SkAppVersionAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.