@unsource/ui 2.7.17 → 2.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.7.17",
4
+ "version": "2.7.18",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -7,7 +7,8 @@ export declare const getSections: () => Promise<Section | never[]>;
7
7
  export declare const getCategorySection: (data: Slider) => Promise<InputOption[]>;
8
8
  export declare const getOption: (key: string, params?: {}) => Promise<InputOption | null>;
9
9
  export declare const getOptions: (key: string) => Promise<InputOption[]>;
10
- export declare const getTransactions: (walletIds: string[], justWallet?: boolean) => Promise<Transaction[] | undefined>;
10
+ export declare const getMyTransactions: (q?: {}) => Promise<Transaction[] | undefined>;
11
+ export declare const getTransactions: (q?: {}) => Promise<Transaction[] | undefined>;
11
12
  export declare const saveUser: (user: User) => Promise<Profile | undefined>;
12
13
  export declare const saveProfile: (profile: Profile) => Promise<Profile | undefined>;
13
14
  export declare const saveWithdraw: (withdraw: any) => Promise<unknown>;
@@ -90,15 +90,14 @@ export const getOptions = async (key) => {
90
90
  });
91
91
  return result || [];
92
92
  };
93
- export const getTransactions = async (walletIds, justWallet = false) => {
93
+ export const getMyTransactions = async (q = {}) => {
94
94
  const userId = useUserId();
95
+ if (!userId.value) return [];
95
96
  const { result } = await useGet("/transaction", {
96
97
  params: {
97
- "$w.OR.0.walletId.in": justWallet ? void 0 : walletIds,
98
- "$w.OR.1.toWalletId.in": justWallet ? void 0 : walletIds,
99
- "$w.OR.2.userId": justWallet ? void 0 : userId.value,
100
- "$w.OR.0.walletId": justWallet ? walletIds : void 0,
101
- "$w.OR.1.toWalletId": justWallet ? walletIds : void 0,
98
+ "$w.OR.0.wallet.userId": userId.value,
99
+ "$w.OR.1.toWallet.userId": userId.value,
100
+ "$w.OR.2.userId": userId.value,
102
101
  "$w.status:not": "PENDING",
103
102
  "$i.gateway.$i.gateway": true,
104
103
  "$i.gateway.$i.coin": true,
@@ -106,7 +105,24 @@ export const getTransactions = async (walletIds, justWallet = false) => {
106
105
  "$i.toWallet.$i.coin": true,
107
106
  "$o.createdAt": "desc",
108
107
  "$i.wallet.$i.user.$i.profile": true,
109
- "$i.toWallet.$i.user.$i.profile": true
108
+ "$i.toWallet.$i.user.$i.profile": true,
109
+ ...q
110
+ }
111
+ });
112
+ return result;
113
+ };
114
+ export const getTransactions = async (q = {}) => {
115
+ const { result } = await useGet("/transaction", {
116
+ params: {
117
+ "$w.status:not": "PENDING",
118
+ "$i.gateway.$i.gateway": true,
119
+ "$i.gateway.$i.coin": true,
120
+ "$i.wallet.$i.coin": true,
121
+ "$i.toWallet.$i.coin": true,
122
+ "$o.createdAt": "desc",
123
+ "$i.wallet.$i.user.$i.profile": true,
124
+ "$i.toWallet.$i.user.$i.profile": true,
125
+ ...q
110
126
  }
111
127
  });
112
128
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.7.17",
3
+ "version": "2.7.18",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",