feeds-fun 0.5.0 → 0.6.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.
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<a
|
|
20
20
|
href="#"
|
|
21
21
|
v-if="canCreateRule"
|
|
22
|
-
@click.prevent="
|
|
22
|
+
@click.prevent="createOrUpdateRule()"
|
|
23
23
|
>create rule</a
|
|
24
24
|
>
|
|
25
25
|
</div>
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
return properties.tags.length > 0;
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
async function
|
|
45
|
-
await api.
|
|
44
|
+
async function createOrUpdateRule() {
|
|
45
|
+
await api.createOrUpdateRule({tags: properties.tags, score: currentScore.value});
|
|
46
46
|
emit("rule-constructor:created");
|
|
47
47
|
}
|
|
48
48
|
</script>
|
package/src/logic/api.ts
CHANGED
|
@@ -8,7 +8,7 @@ const ENTRY_POINT = "/api";
|
|
|
8
8
|
const API_GET_FEEDS = `${ENTRY_POINT}/get-feeds`;
|
|
9
9
|
const API_GET_LAST_ENTRIES = `${ENTRY_POINT}/get-last-entries`;
|
|
10
10
|
const API_GET_ENTRIES_BY_IDS = `${ENTRY_POINT}/get-entries-by-ids`;
|
|
11
|
-
const
|
|
11
|
+
const API_CREATE_OR_UPDATE_RULE = `${ENTRY_POINT}/create-or-update-rule`;
|
|
12
12
|
|
|
13
13
|
const API_DELETE_RULE = `${ENTRY_POINT}/delete-rule`;
|
|
14
14
|
const API_UPDATE_RULE = `${ENTRY_POINT}/update-rule`;
|
|
@@ -97,9 +97,9 @@ export async function getEntriesByIds({ids}: {ids: t.EntryId[]}) {
|
|
|
97
97
|
return entries;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export async function
|
|
100
|
+
export async function createOrUpdateRule({tags, score}: {tags: string[]; score: number}) {
|
|
101
101
|
const response = await post({
|
|
102
|
-
url:
|
|
102
|
+
url: API_CREATE_OR_UPDATE_RULE,
|
|
103
103
|
data: {tags: tags, score: score}
|
|
104
104
|
});
|
|
105
105
|
return response;
|
package/src/values/Score.vue
CHANGED
|
@@ -32,7 +32,11 @@
|
|
|
32
32
|
|
|
33
33
|
for (const tagId of rule.tags) {
|
|
34
34
|
const tagInfo = tagsStore.tags[tagId];
|
|
35
|
-
|
|
35
|
+
if (tagInfo) {
|
|
36
|
+
tags.push(tagInfo.name);
|
|
37
|
+
} else {
|
|
38
|
+
tags.push(tagId);
|
|
39
|
+
}
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
strings.push(rule.score.toString().padStart(2, " ") + " — " + tags.join(", "));
|