-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwishlist.service.ts
More file actions
38 lines (36 loc) · 967 Bytes
/
wishlist.service.ts
File metadata and controls
38 lines (36 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type {
WishlistItemCountResponse,
WishlistResponse,
} from '../schemas/responses/wishlist.schemas'
import { BaseService } from './_base.service'
export class WishlistService extends BaseService {
constructor(apiKey: string) {
super(apiKey, 'api', 'IWishlistService')
}
/**
* Get a users wishlist
*/
async getWishlist(steamUserId: string): Promise<WishlistResponse> {
const url = this.generateSteamUrl(`/GetWishlist/v1`, {
steamid: steamUserId,
})
const response = await this.sendGETRequest<{
response: WishlistResponse
}>(url)
return response.response
}
/**
* Get the number of items in a users wishlist
*/
async getWishlistItemCount(
steamUserId: string,
): Promise<WishlistItemCountResponse> {
const url = this.generateSteamUrl(`/GetWishlistItemCount/v1`, {
steamid: steamUserId,
})
const response = await this.sendGETRequest<{
response: WishlistItemCountResponse
}>(url)
return response.response
}
}