@comapeo/core-react 3.1.0 → 3.2.0

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.
@@ -119,13 +119,23 @@ export declare function useCreateDocument<D extends WriteableDocumentType>({ doc
119
119
  docType: D;
120
120
  projectId: string;
121
121
  }): {
122
+ error: Error;
122
123
  mutate: import("@tanstack/react-query").UseMutateFunction<import("../lib/types.js").WriteableDocument<D> & {
123
124
  forks: Array<string>;
124
125
  }, Error, {
125
126
  value: Omit<import("../lib/types.js").WriteableValue<D>, "schemaName">;
126
127
  }, unknown>;
127
128
  reset: () => void;
128
- status: "pending" | "error" | "success" | "idle";
129
+ status: "error";
130
+ } | {
131
+ error: null;
132
+ mutate: import("@tanstack/react-query").UseMutateFunction<import("../lib/types.js").WriteableDocument<D> & {
133
+ forks: Array<string>;
134
+ }, Error, {
135
+ value: Omit<import("../lib/types.js").WriteableValue<D>, "schemaName">;
136
+ }, unknown>;
137
+ reset: () => void;
138
+ status: "pending" | "success" | "idle";
129
139
  };
130
140
  /**
131
141
  * Update a document within a project.
@@ -137,6 +147,7 @@ export declare function useUpdateDocument<D extends WriteableDocumentType>({ doc
137
147
  docType: D;
138
148
  projectId: string;
139
149
  }): {
150
+ error: Error;
140
151
  mutate: import("@tanstack/react-query").UseMutateFunction<import("../lib/types.js").WriteableDocument<D> & {
141
152
  forks: Array<string>;
142
153
  }, Error, {
@@ -144,7 +155,17 @@ export declare function useUpdateDocument<D extends WriteableDocumentType>({ doc
144
155
  value: Omit<import("../lib/types.js").WriteableValue<D>, "schemaName">;
145
156
  }, unknown>;
146
157
  reset: () => void;
147
- status: "pending" | "error" | "success" | "idle";
158
+ status: "error";
159
+ } | {
160
+ error: null;
161
+ mutate: import("@tanstack/react-query").UseMutateFunction<import("../lib/types.js").WriteableDocument<D> & {
162
+ forks: Array<string>;
163
+ }, Error, {
164
+ versionId: string;
165
+ value: Omit<import("../lib/types.js").WriteableValue<D>, "schemaName">;
166
+ }, unknown>;
167
+ reset: () => void;
168
+ status: "pending" | "success" | "idle";
148
169
  };
149
170
  /**
150
171
  * Delete a document within a project.
@@ -156,12 +177,22 @@ export declare function useDeleteDocument<D extends WriteableDocumentType>({ doc
156
177
  docType: D;
157
178
  projectId: string;
158
179
  }): {
180
+ error: Error;
181
+ mutate: import("@tanstack/react-query").UseMutateFunction<import("../lib/types.js").WriteableDocument<D> & {
182
+ forks: Array<string>;
183
+ }, Error, {
184
+ docId: string;
185
+ }, unknown>;
186
+ reset: () => void;
187
+ status: "error";
188
+ } | {
189
+ error: null;
159
190
  mutate: import("@tanstack/react-query").UseMutateFunction<import("../lib/types.js").WriteableDocument<D> & {
160
191
  forks: Array<string>;
161
192
  }, Error, {
162
193
  docId: string;
163
194
  }, unknown>;
164
195
  reset: () => void;
165
- status: "pending" | "error" | "success" | "idle";
196
+ status: "pending" | "success" | "idle";
166
197
  };
167
198
  export {};
@@ -140,13 +140,15 @@ export function useManyDocs({ projectId, docType, includeDeleted, lang, }) {
140
140
  export function useCreateDocument({ docType, projectId, }) {
141
141
  const queryClient = useQueryClient();
142
142
  const { data: projectApi } = useSingleProject({ projectId });
143
- const { mutate, reset, status } = useMutation(createDocumentMutationOptions({
143
+ const { error, mutate, reset, status } = useMutation(createDocumentMutationOptions({
144
144
  docType,
145
145
  projectApi,
146
146
  projectId,
147
147
  queryClient,
148
148
  }));
149
- return { mutate, reset, status };
149
+ return status === 'error'
150
+ ? { error, mutate, reset, status }
151
+ : { error: null, mutate, reset, status };
150
152
  }
151
153
  /**
152
154
  * Update a document within a project.
@@ -157,13 +159,15 @@ export function useCreateDocument({ docType, projectId, }) {
157
159
  export function useUpdateDocument({ docType, projectId, }) {
158
160
  const queryClient = useQueryClient();
159
161
  const { data: projectApi } = useSingleProject({ projectId });
160
- const { mutate, reset, status } = useMutation(updateDocumentMutationOptions({
162
+ const { error, mutate, reset, status } = useMutation(updateDocumentMutationOptions({
161
163
  docType,
162
164
  projectApi,
163
165
  projectId,
164
166
  queryClient,
165
167
  }));
166
- return { mutate, reset, status };
168
+ return status === 'error'
169
+ ? { error, mutate, reset, status }
170
+ : { error: null, mutate, reset, status };
167
171
  }
168
172
  /**
169
173
  * Delete a document within a project.
@@ -174,11 +178,13 @@ export function useUpdateDocument({ docType, projectId, }) {
174
178
  export function useDeleteDocument({ docType, projectId, }) {
175
179
  const queryClient = useQueryClient();
176
180
  const { data: projectApi } = useSingleProject({ projectId });
177
- const { mutate, reset, status } = useMutation(deleteDocumentMutationOptions({
181
+ const { error, mutate, reset, status } = useMutation(deleteDocumentMutationOptions({
178
182
  docType,
179
183
  projectApi,
180
184
  projectId,
181
185
  queryClient,
182
186
  }));
183
- return { mutate, reset, status };
187
+ return status === 'error'
188
+ ? { error, mutate, reset, status }
189
+ : { error: null, mutate, reset, status };
184
190
  }
@@ -2,21 +2,37 @@
2
2
  * Accept an invite that has been received.
3
3
  */
4
4
  export declare function useAcceptInvite(): {
5
+ error: Error;
5
6
  mutate: import("@tanstack/react-query").UseMutateFunction<string, Error, {
6
7
  inviteId: string;
7
8
  }, unknown>;
8
9
  reset: () => void;
9
- status: "pending" | "error" | "success" | "idle";
10
+ status: "error";
11
+ } | {
12
+ error: null;
13
+ mutate: import("@tanstack/react-query").UseMutateFunction<string, Error, {
14
+ inviteId: string;
15
+ }, unknown>;
16
+ reset: () => void;
17
+ status: "pending" | "success" | "idle";
10
18
  };
11
19
  /**
12
20
  * Reject an invite that has been received.
13
21
  */
14
22
  export declare function useRejectInvite(): {
23
+ error: Error;
24
+ mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
25
+ inviteId: string;
26
+ }, unknown>;
27
+ reset: () => void;
28
+ status: "error";
29
+ } | {
30
+ error: null;
15
31
  mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
16
32
  inviteId: string;
17
33
  }, unknown>;
18
34
  reset: () => void;
19
- status: "pending" | "error" | "success" | "idle";
35
+ status: "pending" | "success" | "idle";
20
36
  };
21
37
  /**
22
38
  * Send an invite for a project.
@@ -26,6 +42,7 @@ export declare function useRejectInvite(): {
26
42
  export declare function useSendInvite({ projectId }: {
27
43
  projectId: string;
28
44
  }): {
45
+ error: Error;
29
46
  mutate: import("@tanstack/react-query").UseMutateFunction<"ACCEPT" | "REJECT" | "ALREADY", Error, {
30
47
  deviceId: string;
31
48
  roleDescription?: string;
@@ -33,7 +50,17 @@ export declare function useSendInvite({ projectId }: {
33
50
  roleName?: string;
34
51
  }, unknown>;
35
52
  reset: () => void;
36
- status: "pending" | "error" | "success" | "idle";
53
+ status: "error";
54
+ } | {
55
+ error: null;
56
+ mutate: import("@tanstack/react-query").UseMutateFunction<"ACCEPT" | "REJECT" | "ALREADY", Error, {
57
+ deviceId: string;
58
+ roleDescription?: string;
59
+ roleId: import("@comapeo/core/dist/roles.js").RoleIdForNewInvite;
60
+ roleName?: string;
61
+ }, unknown>;
62
+ reset: () => void;
63
+ status: "pending" | "success" | "idle";
37
64
  };
38
65
  /**
39
66
  * Request a cancellation of an invite sent to another device.
@@ -43,9 +70,17 @@ export declare function useSendInvite({ projectId }: {
43
70
  export declare function useRequestCancelInvite({ projectId }: {
44
71
  projectId: string;
45
72
  }): {
73
+ error: Error;
74
+ mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
75
+ deviceId: string;
76
+ }, unknown>;
77
+ reset: () => void;
78
+ status: "error";
79
+ } | {
80
+ error: null;
46
81
  mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
47
82
  deviceId: string;
48
83
  }, unknown>;
49
84
  reset: () => void;
50
- status: "pending" | "error" | "success" | "idle";
85
+ status: "pending" | "success" | "idle";
51
86
  };
@@ -8,8 +8,10 @@ import { useSingleProject } from './projects.js';
8
8
  export function useAcceptInvite() {
9
9
  const queryClient = useQueryClient();
10
10
  const clientApi = useClientApi();
11
- const { mutate, status, reset } = useMutation(acceptInviteMutationOptions({ clientApi, queryClient }));
12
- return { mutate, reset, status };
11
+ const { error, mutate, reset, status } = useMutation(acceptInviteMutationOptions({ clientApi, queryClient }));
12
+ return status === 'error'
13
+ ? { error, mutate, reset, status }
14
+ : { error: null, mutate, reset, status };
13
15
  }
14
16
  /**
15
17
  * Reject an invite that has been received.
@@ -17,8 +19,10 @@ export function useAcceptInvite() {
17
19
  export function useRejectInvite() {
18
20
  const queryClient = useQueryClient();
19
21
  const clientApi = useClientApi();
20
- const { mutate, status, reset } = useMutation(rejectInviteMutationOptions({ clientApi, queryClient }));
21
- return { mutate, reset, status };
22
+ const { error, mutate, reset, status } = useMutation(rejectInviteMutationOptions({ clientApi, queryClient }));
23
+ return status === 'error'
24
+ ? { error, mutate, reset, status }
25
+ : { error: null, mutate, reset, status };
22
26
  }
23
27
  /**
24
28
  * Send an invite for a project.
@@ -28,8 +32,10 @@ export function useRejectInvite() {
28
32
  export function useSendInvite({ projectId }) {
29
33
  const queryClient = useQueryClient();
30
34
  const { data: projectApi } = useSingleProject({ projectId });
31
- const { mutate, status, reset } = useMutation(sendInviteMutationOptions({ projectApi, projectId, queryClient }));
32
- return { mutate, reset, status };
35
+ const { error, mutate, reset, status } = useMutation(sendInviteMutationOptions({ projectApi, projectId, queryClient }));
36
+ return status === 'error'
37
+ ? { error, mutate, reset, status }
38
+ : { error: null, mutate, reset, status };
33
39
  }
34
40
  /**
35
41
  * Request a cancellation of an invite sent to another device.
@@ -39,6 +45,8 @@ export function useSendInvite({ projectId }) {
39
45
  export function useRequestCancelInvite({ projectId }) {
40
46
  const queryClient = useQueryClient();
41
47
  const { data: projectApi } = useSingleProject({ projectId });
42
- const { mutate, status, reset } = useMutation(requestCancelInviteMutationOptions({ projectApi, queryClient }));
43
- return { mutate, reset, status };
48
+ const { error, mutate, reset, status } = useMutation(requestCancelInviteMutationOptions({ projectApi, queryClient }));
49
+ return status === 'error'
50
+ ? { error, mutate, reset, status }
51
+ : { error: null, mutate, reset, status };
44
52
  }
@@ -275,33 +275,59 @@ export declare function useOwnRoleInProject({ projectId }: {
275
275
  export declare function useAddServerPeer({ projectId }: {
276
276
  projectId: string;
277
277
  }): {
278
+ error: Error;
278
279
  mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
279
280
  baseUrl: string;
280
281
  dangerouslyAllowInsecureConnections?: boolean;
281
282
  }, unknown>;
282
283
  reset: () => void;
283
- status: "pending" | "error" | "success" | "idle";
284
+ status: "error";
285
+ } | {
286
+ error: null;
287
+ mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
288
+ baseUrl: string;
289
+ dangerouslyAllowInsecureConnections?: boolean;
290
+ }, unknown>;
291
+ reset: () => void;
292
+ status: "pending" | "success" | "idle";
284
293
  };
285
294
  /**
286
295
  * Create a new project.
287
296
  */
288
297
  export declare function useCreateProject(): {
298
+ error: Error;
289
299
  mutate: import("@tanstack/react-query").UseMutateFunction<string, Error, {
290
300
  name?: string;
291
301
  configPath?: string;
292
302
  } | undefined, unknown>;
293
303
  reset: () => void;
294
- status: "pending" | "error" | "success" | "idle";
304
+ status: "error";
305
+ } | {
306
+ error: null;
307
+ mutate: import("@tanstack/react-query").UseMutateFunction<string, Error, {
308
+ name?: string;
309
+ configPath?: string;
310
+ } | undefined, unknown>;
311
+ reset: () => void;
312
+ status: "pending" | "success" | "idle";
295
313
  };
296
314
  /**
297
315
  * Leave an existing project.
298
316
  */
299
317
  export declare function useLeaveProject(): {
318
+ error: Error;
300
319
  mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
301
320
  projectId: string;
302
321
  }, unknown>;
303
322
  reset: () => void;
304
- status: "pending" | "error" | "success" | "idle";
323
+ status: "error";
324
+ } | {
325
+ error: null;
326
+ mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
327
+ projectId: string;
328
+ }, unknown>;
329
+ reset: () => void;
330
+ status: "pending" | "success" | "idle";
305
331
  };
306
332
  /**
307
333
  * Update the configuration of a project using an external file.
@@ -311,11 +337,19 @@ export declare function useLeaveProject(): {
311
337
  export declare function useImportProjectConfig({ projectId }: {
312
338
  projectId: string;
313
339
  }): {
340
+ error: Error;
341
+ mutate: import("@tanstack/react-query").UseMutateFunction<Error[], Error, {
342
+ configPath: string;
343
+ }, unknown>;
344
+ reset: () => void;
345
+ status: "error";
346
+ } | {
347
+ error: null;
314
348
  mutate: import("@tanstack/react-query").UseMutateFunction<Error[], Error, {
315
349
  configPath: string;
316
350
  }, unknown>;
317
351
  reset: () => void;
318
- status: "pending" | "error" | "success" | "idle";
352
+ status: "pending" | "success" | "idle";
319
353
  };
320
354
  /**
321
355
  * Update the settings of a project.
@@ -325,13 +359,23 @@ export declare function useImportProjectConfig({ projectId }: {
325
359
  export declare function useUpdateProjectSettings({ projectId }: {
326
360
  projectId: string;
327
361
  }): {
362
+ error: Error;
363
+ mutate: import("@tanstack/react-query").UseMutateFunction<import("@comapeo/core/dist/mapeo-project.js").EditableProjectSettings, Error, {
364
+ name?: import("@comapeo/schema").ProjectSettings["name"];
365
+ configMetadata?: import("@comapeo/schema").ProjectSettings["configMetadata"];
366
+ defaultPresets?: import("@comapeo/schema").ProjectSettings["defaultPresets"];
367
+ }, unknown>;
368
+ reset: () => void;
369
+ status: "error";
370
+ } | {
371
+ error: null;
328
372
  mutate: import("@tanstack/react-query").UseMutateFunction<import("@comapeo/core/dist/mapeo-project.js").EditableProjectSettings, Error, {
329
373
  name?: import("@comapeo/schema").ProjectSettings["name"];
330
374
  configMetadata?: import("@comapeo/schema").ProjectSettings["configMetadata"];
331
375
  defaultPresets?: import("@comapeo/schema").ProjectSettings["defaultPresets"];
332
376
  }, unknown>;
333
377
  reset: () => void;
334
- status: "pending" | "error" | "success" | "idle";
378
+ status: "pending" | "success" | "idle";
335
379
  };
336
380
  /**
337
381
  * Create a blob for a project.
@@ -341,6 +385,7 @@ export declare function useUpdateProjectSettings({ projectId }: {
341
385
  export declare function useCreateBlob({ projectId }: {
342
386
  projectId: string;
343
387
  }): {
388
+ error: Error;
344
389
  mutate: import("@tanstack/react-query").UseMutateFunction<{
345
390
  driveId: string;
346
391
  name: string;
@@ -353,7 +398,22 @@ export declare function useCreateBlob({ projectId }: {
353
398
  metadata: import("@comapeo/core/dist/blob-api.js").Metadata;
354
399
  }, unknown>;
355
400
  reset: () => void;
356
- status: "pending" | "error" | "success" | "idle";
401
+ status: "error";
402
+ } | {
403
+ error: null;
404
+ mutate: import("@tanstack/react-query").UseMutateFunction<{
405
+ driveId: string;
406
+ name: string;
407
+ type: "photo" | "video" | "audio";
408
+ hash: string;
409
+ }, Error, {
410
+ original: string;
411
+ preview?: string;
412
+ thumbnail?: string;
413
+ metadata: import("@comapeo/core/dist/blob-api.js").Metadata;
414
+ }, unknown>;
415
+ reset: () => void;
416
+ status: "pending" | "success" | "idle";
357
417
  };
358
418
  /**
359
419
  * Hook to subscribe to the current sync state.
@@ -391,16 +451,30 @@ export declare function useDataSyncProgress({ projectId, }: {
391
451
  export declare function useStartSync({ projectId }: {
392
452
  projectId: string;
393
453
  }): {
454
+ error: Error;
455
+ mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
456
+ autostopDataSyncAfter: number | null;
457
+ } | undefined, unknown>;
458
+ reset: () => void;
459
+ status: "error";
460
+ } | {
461
+ error: null;
394
462
  mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
395
463
  autostopDataSyncAfter: number | null;
396
464
  } | undefined, unknown>;
397
465
  reset: () => void;
398
- status: "pending" | "error" | "success" | "idle";
466
+ status: "pending" | "success" | "idle";
399
467
  };
400
468
  export declare function useStopSync({ projectId }: {
401
469
  projectId: string;
402
470
  }): {
471
+ error: Error;
472
+ mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, void, unknown>;
473
+ reset: () => void;
474
+ status: "error";
475
+ } | {
476
+ error: null;
403
477
  mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, void, unknown>;
404
478
  reset: () => void;
405
- status: "pending" | "error" | "success" | "idle";
479
+ status: "pending" | "success" | "idle";
406
480
  };
@@ -271,8 +271,10 @@ export function useOwnRoleInProject({ projectId }) {
271
271
  export function useAddServerPeer({ projectId }) {
272
272
  const queryClient = useQueryClient();
273
273
  const { data: projectApi } = useSingleProject({ projectId });
274
- const { mutate, reset, status } = useMutation(addServerPeerMutationOptions({ projectApi, projectId, queryClient }));
275
- return { mutate, reset, status };
274
+ const { error, mutate, reset, status } = useMutation(addServerPeerMutationOptions({ projectApi, projectId, queryClient }));
275
+ return status === 'error'
276
+ ? { error, mutate, reset, status }
277
+ : { error: null, mutate, reset, status };
276
278
  }
277
279
  /**
278
280
  * Create a new project.
@@ -280,8 +282,10 @@ export function useAddServerPeer({ projectId }) {
280
282
  export function useCreateProject() {
281
283
  const queryClient = useQueryClient();
282
284
  const clientApi = useClientApi();
283
- const { mutate, status, reset } = useMutation(createProjectMutationOptions({ clientApi, queryClient }));
284
- return { mutate, reset, status };
285
+ const { error, mutate, reset, status } = useMutation(createProjectMutationOptions({ clientApi, queryClient }));
286
+ return status === 'error'
287
+ ? { error, mutate, reset, status }
288
+ : { error: null, mutate, reset, status };
285
289
  }
286
290
  /**
287
291
  * Leave an existing project.
@@ -289,8 +293,10 @@ export function useCreateProject() {
289
293
  export function useLeaveProject() {
290
294
  const queryClient = useQueryClient();
291
295
  const clientApi = useClientApi();
292
- const { mutate, status, reset } = useMutation(leaveProjectMutationOptions({ clientApi, queryClient }));
293
- return { mutate, reset, status };
296
+ const { error, mutate, reset, status } = useMutation(leaveProjectMutationOptions({ clientApi, queryClient }));
297
+ return status === 'error'
298
+ ? { error, mutate, reset, status }
299
+ : { error: null, mutate, reset, status };
294
300
  }
295
301
  /**
296
302
  * Update the configuration of a project using an external file.
@@ -300,8 +306,10 @@ export function useLeaveProject() {
300
306
  export function useImportProjectConfig({ projectId }) {
301
307
  const queryClient = useQueryClient();
302
308
  const { data: projectApi } = useSingleProject({ projectId });
303
- const { mutate, status, reset } = useMutation(importProjectConfigMutationOptions({ queryClient, projectApi, projectId }));
304
- return { mutate, reset, status };
309
+ const { error, mutate, reset, status } = useMutation(importProjectConfigMutationOptions({ queryClient, projectApi, projectId }));
310
+ return status === 'error'
311
+ ? { error, mutate, reset, status }
312
+ : { error: null, mutate, reset, status };
305
313
  }
306
314
  /**
307
315
  * Update the settings of a project.
@@ -311,8 +319,10 @@ export function useImportProjectConfig({ projectId }) {
311
319
  export function useUpdateProjectSettings({ projectId }) {
312
320
  const queryClient = useQueryClient();
313
321
  const { data: projectApi } = useSingleProject({ projectId });
314
- const { mutate, reset, status } = useMutation(updateProjectSettingsMutationOptions({ projectApi, queryClient }));
315
- return { mutate, reset, status };
322
+ const { error, mutate, reset, status } = useMutation(updateProjectSettingsMutationOptions({ projectApi, queryClient }));
323
+ return status === 'error'
324
+ ? { error, mutate, reset, status }
325
+ : { error: null, mutate, reset, status };
316
326
  }
317
327
  /**
318
328
  * Create a blob for a project.
@@ -321,8 +331,10 @@ export function useUpdateProjectSettings({ projectId }) {
321
331
  */
322
332
  export function useCreateBlob({ projectId }) {
323
333
  const { data: projectApi } = useSingleProject({ projectId });
324
- const { mutate, reset, status } = useMutation(createBlobMutationOptions({ projectApi }));
325
- return { mutate, reset, status };
334
+ const { error, mutate, reset, status } = useMutation(createBlobMutationOptions({ projectApi }));
335
+ return status === 'error'
336
+ ? { error, mutate, reset, status }
337
+ : { error: null, mutate, reset, status };
326
338
  }
327
339
  const PROJECT_SYNC_STORE_MAP = new WeakMap();
328
340
  function useSyncStore({ projectId }) {
@@ -372,11 +384,15 @@ export function useDataSyncProgress({ projectId, }) {
372
384
  }
373
385
  export function useStartSync({ projectId }) {
374
386
  const { data: projectApi } = useSingleProject({ projectId });
375
- const { mutate, reset, status } = useMutation(startSyncMutationOptions({ projectApi }));
376
- return { mutate, reset, status };
387
+ const { mutate, reset, status, error } = useMutation(startSyncMutationOptions({ projectApi }));
388
+ return status === 'error'
389
+ ? { error, mutate, reset, status }
390
+ : { error: null, mutate, reset, status };
377
391
  }
378
392
  export function useStopSync({ projectId }) {
379
393
  const { data: projectApi } = useSingleProject({ projectId });
380
- const { mutate, reset, status } = useMutation(stopSyncMutationOptions({ projectApi }));
381
- return { mutate, reset, status };
394
+ const { error, mutate, reset, status } = useMutation(stopSyncMutationOptions({ projectApi }));
395
+ return status === 'error'
396
+ ? { error, mutate, reset, status }
397
+ : { error: null, mutate, reset, status };
382
398
  }