mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-29 15:45:18 +08:00
feat: updateRule omit 'id'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { BangumiRule } from '#/bangumi';
|
||||
import type { BangumiRule, BangumiUpdate } from '#/bangumi';
|
||||
import type { ApiSuccess } from '#/api';
|
||||
|
||||
export const apiBangumi = {
|
||||
@@ -32,9 +32,11 @@ export const apiBangumi = {
|
||||
* @returns axios 请求返回的数据
|
||||
*/
|
||||
async updateRule(bangumiId: number, bangumiRule: BangumiRule) {
|
||||
const rule = omit(bangumiRule, ['id']);
|
||||
|
||||
const { data } = await axios.patch<ApiSuccess>(
|
||||
`api/v1/bangumi/update/${bangumiId}`,
|
||||
bangumiRule
|
||||
rule
|
||||
);
|
||||
return data;
|
||||
},
|
||||
|
||||
@@ -20,6 +20,8 @@ export interface BangumiRule {
|
||||
year: string | null;
|
||||
}
|
||||
|
||||
export type BangumiUpdate = Omit<BangumiRule, 'id'>;
|
||||
|
||||
export const ruleTemplate: BangumiRule = {
|
||||
added: false,
|
||||
deleted: false,
|
||||
|
||||
1
webui/types/dts/auto-imports.d.ts
vendored
1
webui/types/dts/auto-imports.d.ts
vendored
@@ -70,6 +70,7 @@ declare global {
|
||||
const mapWritableState: typeof import('pinia')['mapWritableState']
|
||||
const markRaw: typeof import('vue')['markRaw']
|
||||
const nextTick: typeof import('vue')['nextTick']
|
||||
const omit: typeof import('../../src/utils/omit')['omit']
|
||||
const onActivated: typeof import('vue')['onActivated']
|
||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
||||
const onBeforeRouteLeave: typeof import('vue-router/auto')['onBeforeRouteLeave']
|
||||
|
||||
Reference in New Issue
Block a user