bazarr/frontend/src/apis/raw/series.ts

34 lines
722 B
TypeScript
Raw Normal View History

2021-03-25 14:22:43 +00:00
import BaseApi from "./base";
class SeriesApi extends BaseApi {
constructor() {
super("/series");
}
async series(seriesid?: number[]) {
const response = await this.get<DataWrapperWithTotal<Item.Series>>("", {
2021-08-17 14:52:50 +00:00
seriesid,
2021-03-25 14:22:43 +00:00
});
return response.data;
2021-03-25 14:22:43 +00:00
}
async seriesBy(params: Parameter.Range) {
const response = await this.get<DataWrapperWithTotal<Item.Series>>(
"",
params
);
2021-08-17 14:52:50 +00:00
return response;
2021-03-25 14:22:43 +00:00
}
async modify(form: FormType.ModifyItem) {
2021-08-17 14:52:50 +00:00
await this.post("", { seriesid: form.id, profileid: form.profileid });
2021-03-25 14:22:43 +00:00
}
async action(form: FormType.SeriesAction) {
2021-08-17 14:52:50 +00:00
await this.patch("", form);
2021-03-25 14:22:43 +00:00
}
}
const seriesApi = new SeriesApi();
export default seriesApi;