You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.4 KiB

import{s as e}from"./index-D5exsJys.js";async function t(t){let{data:n}=await e.post(`/reviewers`,t),r=n?.data??n;if(!r||typeof r!=`object`)throw Error(`创建响应无效`);return r}async function n(t,n){let{data:r}=await e.patch(`/reviewers/${t}`,n),i=r?.data??r;if(!i||typeof i!=`object`)throw Error(`更新响应无效`);return i}async function r(t){await e.post(`/reviewers/${t}/delete`)}function i(e){if(!e||typeof e!=`object`)throw Error(`列表响应格式无效`);let t=e;if(Array.isArray(t.data)&&typeof t.current_page==`number`){let e=t.data;return{data:e,meta:{current_page:t.current_page,last_page:typeof t.last_page==`number`?t.last_page:1,per_page:typeof t.per_page==`number`?t.per_page:e.length||15,total:typeof t.total==`number`?t.total:e.length}}}throw Error(`列表响应格式无效`)}async function a(t){let{data:n}=await e.get(`/reviewer-scopes`,{params:t});return i(n)}async function o(t){let{data:n}=await e.get(`/competitions/${t}/reviewer-scope-track-counts`),r=n?.data??n;return!r||typeof r!=`object`?{}:r}async function s(t){let{data:n}=await e.get(`/competitions/${t}/reviewer-scope-region-counts`),r=n?.data??n;return!r||typeof r!=`object`?{}:r}async function c(t){let{data:n}=await e.post(`/reviewer-scopes`,t),r=n?.data??n;if(!r||typeof r!=`object`)throw Error(`创建响应无效`);return r}async function l(t){await e.post(`/reviewer-scopes/${t}/delete`)}export{a,n as c,o as i,l as n,t as o,s as r,r as s,c as t};