anymal-protocol 1.0.91 → 1.0.92

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/index.d.mts CHANGED
@@ -19,6 +19,11 @@ declare function useUpdateUserPid(): (dbAuthToken: string, docID: string, pid: s
19
19
  declare function useUpdateUserAsVerified(): (recaptchaToken: string | null, docID: string, dbAuthToken: string, endpoint: string) => Promise<{
20
20
  success: boolean;
21
21
  message: string;
22
+ dbCid: any;
23
+ } | {
24
+ success: boolean;
25
+ message: string;
26
+ dbCid?: undefined;
22
27
  } | undefined>;
23
28
 
24
29
  declare function useUpdateUserName(): (dbAuthToken: string, docID: string, name: string, endpoint: string) => Promise<{
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@ declare function useUpdateUserPid(): (dbAuthToken: string, docID: string, pid: s
19
19
  declare function useUpdateUserAsVerified(): (recaptchaToken: string | null, docID: string, dbAuthToken: string, endpoint: string) => Promise<{
20
20
  success: boolean;
21
21
  message: string;
22
+ dbCid: any;
23
+ } | {
24
+ success: boolean;
25
+ message: string;
26
+ dbCid?: undefined;
22
27
  } | undefined>;
23
28
 
24
29
  declare function useUpdateUserName(): (dbAuthToken: string, docID: string, name: string, endpoint: string) => Promise<{
package/dist/index.js CHANGED
@@ -279,6 +279,9 @@ function useUpdateUserAsVerified() {
279
279
  mutation Update_User($docID: [ID], $input: UserMutationInputArg) {
280
280
  update_User(docID: $docID, input: $input) {
281
281
  isVerified
282
+ _version {
283
+ cid
284
+ }
282
285
  }
283
286
  }
284
287
  `;
@@ -299,8 +302,12 @@ function useUpdateUserAsVerified() {
299
302
  variables
300
303
  })
301
304
  });
302
- const responseMessage = response.ok ? "Your account has been verified!" : "An error has occured, try again.";
303
- return { success: response.ok, message: responseMessage };
305
+ const { data, errors } = await response.json();
306
+ if (errors) {
307
+ return { success: false, message: "Error occurred", dbCid: null };
308
+ }
309
+ const dbCid = data.update_User[0]._version[0].cid;
310
+ return { success: true, message: "Account verified", dbCid };
304
311
  } catch (error) {
305
312
  return { success: false, message: error.message };
306
313
  }
package/dist/index.mjs CHANGED
@@ -216,6 +216,9 @@ function useUpdateUserAsVerified() {
216
216
  mutation Update_User($docID: [ID], $input: UserMutationInputArg) {
217
217
  update_User(docID: $docID, input: $input) {
218
218
  isVerified
219
+ _version {
220
+ cid
221
+ }
219
222
  }
220
223
  }
221
224
  `;
@@ -236,8 +239,12 @@ function useUpdateUserAsVerified() {
236
239
  variables
237
240
  })
238
241
  });
239
- const responseMessage = response.ok ? "Your account has been verified!" : "An error has occured, try again.";
240
- return { success: response.ok, message: responseMessage };
242
+ const { data, errors } = await response.json();
243
+ if (errors) {
244
+ return { success: false, message: "Error occurred", dbCid: null };
245
+ }
246
+ const dbCid = data.update_User[0]._version[0].cid;
247
+ return { success: true, message: "Account verified", dbCid };
241
248
  } catch (error) {
242
249
  return { success: false, message: error.message };
243
250
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "description": "A React/TypeScript-based utility library for reusable functions and hooks inside of the Anymal Ecosystem.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {