@fabriktor/fx 0.0.161 → 0.0.162
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/src/feed/feed.d.ts +1 -0
- package/dist/src/feed/feed.js +7 -1
- package/package.json +2 -2
package/dist/src/feed/feed.d.ts
CHANGED
package/dist/src/feed/feed.js
CHANGED
|
@@ -372,7 +372,8 @@ export class FeedFX {
|
|
|
372
372
|
const post_id = feedPostID(opts.post);
|
|
373
373
|
return await this.runAction(post_id, FeedAction.Reaction, async (signal) => {
|
|
374
374
|
const fresh = await this.requireFeedPost(post_id, signal);
|
|
375
|
-
|
|
375
|
+
const id = resolvedID(fresh.self.reaction_id);
|
|
376
|
+
if (id && !opts.replace_existing)
|
|
376
377
|
throw errValidation({
|
|
377
378
|
msg: "An action already exists for this post.",
|
|
378
379
|
});
|
|
@@ -381,6 +382,11 @@ export class FeedFX {
|
|
|
381
382
|
field: "reaction_type",
|
|
382
383
|
msg: "Unsupported reaction.",
|
|
383
384
|
});
|
|
385
|
+
if (id) {
|
|
386
|
+
await this.feed.deleteOneFeedReaction({ signal, id });
|
|
387
|
+
signal.throwIfAborted();
|
|
388
|
+
this.markActionRemoved(post_id, FeedAction.Reaction);
|
|
389
|
+
}
|
|
384
390
|
const out = await this.feed.insertOneFeedReaction({
|
|
385
391
|
signal,
|
|
386
392
|
in: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabriktor/fx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.162",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@fabriktor/client": "0.0.101",
|
|
21
21
|
"@fabriktor/fx": "0.0.94",
|
|
22
|
-
"@fabriktor/schema": "0.0.
|
|
22
|
+
"@fabriktor/schema": "0.0.73",
|
|
23
23
|
"convert": "8.0.2"
|
|
24
24
|
}
|
|
25
25
|
}
|