Skip to content

Commit

Permalink
Merge pull request #856 from Rewrite0/3.1-dev
Browse files Browse the repository at this point in the history
fix: #855
  • Loading branch information
Rewrite0 authored Sep 24, 2024
2 parents d5b84b9 + 94329ae commit ca0d283
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions webui/src/api/search.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Ref } from 'vue';
import type { BangumiRule } from '#/bangumi';
import { omit } from 'radash';
import type { BangumiAPI, BangumiRule } from '#/bangumi';

type EventSourceStatus = 'OPEN' | 'CONNECTING' | 'CLOSED';

Expand Down Expand Up @@ -33,7 +34,12 @@ export const apiSearch = {
status.value = 'OPEN';
};
es.onmessage = (e) => {
const newData = JSON.parse(e.data) as BangumiRule;
const _data = JSON.parse(e.data) as BangumiAPI;
const newData: BangumiRule = {
...omit(_data, ['filter', 'rss_link']),
filter: _data.filter.split(','),
rss_link: _data.rss_link.split(','),
};
data.value = [...data.value, newData];
};
es.onerror = (err) => {
Expand Down

0 comments on commit ca0d283

Please sign in to comment.