@capxul/sdk-react 4.0.1 → 4.1.1
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 +7 -1
- package/dist/index.mjs +15 -7
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -552,7 +552,13 @@ interface ActivityDetailSlice {
|
|
|
552
552
|
readonly isOpeningDocument: boolean;
|
|
553
553
|
readonly memo: string;
|
|
554
554
|
readonly setMemo: (text: string) => void;
|
|
555
|
-
|
|
555
|
+
/** Resolves after save. An unedited memo resolves successfully without a write. */
|
|
556
|
+
readonly saveMemo: () => Promise<{
|
|
557
|
+
readonly ok: true;
|
|
558
|
+
} | {
|
|
559
|
+
readonly ok: false;
|
|
560
|
+
readonly error: CapxulError;
|
|
561
|
+
}>;
|
|
556
562
|
readonly isSavingMemo: boolean;
|
|
557
563
|
readonly isLoading: boolean;
|
|
558
564
|
readonly error: CapxulError | null;
|
package/dist/index.mjs
CHANGED
|
@@ -1149,13 +1149,21 @@ function useActivityDetail(reference, actor) {
|
|
|
1149
1149
|
]);
|
|
1150
1150
|
const [typed, setTyped] = useState(null);
|
|
1151
1151
|
const annotate = useCapxulAnnotateMovement();
|
|
1152
|
-
const saveMemo = useCallback(() => {
|
|
1153
|
-
if (reference === void 0 || typed === null) return;
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1152
|
+
const saveMemo = useCallback(async () => {
|
|
1153
|
+
if (reference === void 0 || typed === null) return { ok: true };
|
|
1154
|
+
try {
|
|
1155
|
+
await annotate.mutateAsync({
|
|
1156
|
+
...actor === void 0 ? {} : { actor },
|
|
1157
|
+
reference,
|
|
1158
|
+
memo: typed
|
|
1159
|
+
});
|
|
1160
|
+
return { ok: true };
|
|
1161
|
+
} catch (error) {
|
|
1162
|
+
return {
|
|
1163
|
+
ok: false,
|
|
1164
|
+
error: isCapxulError(error) ? error : Errors.unknown(error)
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1159
1167
|
}, [
|
|
1160
1168
|
actor,
|
|
1161
1169
|
annotate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@capxul/sdk": "4.
|
|
29
|
+
"@capxul/sdk": "4.1.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tanstack/react-query": "^5.66.9",
|