mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
rework endpoints and enable setting custom marketplace urls
This commit is contained in:
committed by
Aiden McClelland
parent
16f5764f74
commit
6d92c195e9
@@ -44,9 +44,11 @@ export class HttpService {
|
||||
if (isRpcSuccess(res)) return res.result
|
||||
}
|
||||
|
||||
async simpleGet (url: string): Promise<object> {
|
||||
const data = await this.http.get(url).toPromise()
|
||||
return data
|
||||
async simpleGet<T> (url: string, params: { [param: string]: string | string[] } = { }): Promise<T> {
|
||||
Object.keys(params).forEach(key => {
|
||||
if (!params[key]) delete params[key]
|
||||
})
|
||||
return this.http.get<T>(url, { params }).toPromise()
|
||||
}
|
||||
|
||||
async httpRequest<T> (httpOpts: HttpOptions): Promise<T> {
|
||||
|
||||
Reference in New Issue
Block a user