Skip to content

Commit

Permalink
Merge pull request #816 from inplayer-org/plans-methods
Browse files Browse the repository at this point in the history
Search string for InPlayer.Payment.getSitePlans can be any string
  • Loading branch information
mirovladimitrovski authored Jun 19, 2024
2 parents 4ffd2f2 + ada634c commit 9f59875
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

# [3.13.27] - 19-06-2024

### Changes

- Search string for `InPlayer.Payment.getSitePlans` can be any string

# [3.13.26] - 19-06-2024

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ export declare class Payment {
) => Promise<AxiosResponse<CommonResponse>>;
getSitePlans: (
siteId: string,
plansIds?: string[]
searchString?: string
) => Promise<AxiosResponse<PlansListResponse>>;
getSitePlanPrices: (
siteId: string,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inplayer-org/inplayer.js",
"version": "3.13.26",
"version": "3.13.27",
"author": "InPlayer",
"license": "MIT",
"description": "A Javascript SDK for Inplayer's RESTful API",
Expand Down
8 changes: 2 additions & 6 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,8 @@ export const API = {

return url;
},
getSitePlans: (siteId: string, plansIds: string[] = []) =>
`/v3/sites/${siteId}/plans${
plansIds.length
? `?q=id:(${plansIds.map((planId) => `"${planId}"`).join(' OR ')})`
: ''
}`,
getSitePlans: (siteId: string, searchString?: string) =>

Check warning on line 113 in src/constants/index.ts

View workflow job for this annotation

GitHub Actions / Build

Missing return type on function
`/v3/sites/${siteId}/plans${searchString ? `?${searchString}` : ''}`,

getSitePlanPrices: (siteId: string, planId: string) =>

Check warning on line 116 in src/constants/index.ts

View workflow job for this annotation

GitHub Actions / Build

Missing return type on function
`/v3/sites/${siteId}/plans/${planId}/prices`,
Expand Down
4 changes: 2 additions & 2 deletions src/endpoints/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,9 @@ class Payment extends BaseExtend {

async getSitePlans(
siteId: string,
plansIds?: string[]
searchString?: string
): Promise<AxiosResponse<PlansListResponse>> {
return this.request.get(API.getSitePlans(siteId, plansIds), {
return this.request.get(API.getSitePlans(siteId, searchString), {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion src/models/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface ApiEndpoints {
payForAssetDonation: string;
confirmForAssetDonation: string;
validateReceipt: (platform: string) => string;
getSitePlans: (siteId: string, plansIds?: string[]) => string;
getSitePlans: (siteId: string, searchString: string) => string;
getSitePlanPrices: (siteId: string, planId: string) => string;
getAssetsHistory: (
size: number,
Expand Down
2 changes: 1 addition & 1 deletion src/models/IPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export interface Payment extends BaseExtend {

getSitePlans: (
siteId: string,
plansIds?: string[],
searchString?: string,
) => Promise<AxiosResponse<PlansListResponse>>;

getSitePlanPrices: (
Expand Down

0 comments on commit 9f59875

Please sign in to comment.