fix(api): method fix

This commit is contained in:
2026-02-09 18:23:40 +08:00
parent 3f284d057c
commit 0fea0de600
5 changed files with 44 additions and 44 deletions

View File

@@ -7,7 +7,7 @@ import { Project, ProjectDetail, ReviewUsers } from "./typing"
export const getProjectList = (data: Project.ListRequest) => {
return httpFetch<Project.ListResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/project/list",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -20,7 +20,7 @@ export const getProjectList = (data: Project.ListRequest) => {
export const getProjectDetailById = (id: number) => {
return httpFetch<ProjectDetail.DataProps>({
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -32,7 +32,7 @@ export const getProjectDetailById = (id: number) => {
export const checkLabelDataSource = (data: Project.CheckRequest) => {
return httpFetch<Project.CheckResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/project/check_data",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -45,7 +45,7 @@ export const checkLabelDataSource = (data: Project.CheckRequest) => {
export const projectAdd = (data: Project.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/add",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -58,7 +58,7 @@ export const projectAdd = (data: Project.CreateProps) => {
export const projectReview = (data: Project.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/review",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -71,7 +71,7 @@ export const projectReview = (data: Project.CreateProps) => {
export const projectConfig = (data: Project.ConfigProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/config",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -84,7 +84,7 @@ export const projectConfig = (data: Project.ConfigProps) => {
export const projectEditById = (data: any, id: number) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/project/edit/${id}`,
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -97,7 +97,7 @@ export const projectEditById = (data: any, id: number) => {
export const projectPreLabelReview = (data: Project.PreLabelProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/prototype_review",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -110,7 +110,7 @@ export const projectPreLabelReview = (data: Project.PreLabelProps) => {
export const projectDeliver = (data: { project_id: number }) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/deliver",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -123,7 +123,7 @@ export const projectDeliver = (data: { project_id: number }) => {
export const projectAccept = (data: { project_id: number; pass: boolean }) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/accept",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -139,7 +139,7 @@ export const projectCollect = (data: {
}) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/collect",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -152,7 +152,7 @@ export const projectCollect = (data: {
export const getReviewScaleList = (params: { project_id: number }) => {
return httpFetch<any[]>({
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/list",
method: "get",
method: "GET",
data: params,
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -165,7 +165,7 @@ export const getReviewScaleList = (params: { project_id: number }) => {
export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/save",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -177,7 +177,7 @@ export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
export const getProjectDetail = (id: number) => {
return httpFetch<Project.DetailResponse>({
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -189,7 +189,7 @@ export const getProjectDetail = (id: number) => {
export const regenerateProjectEmbedding = (data: { project_id: number }) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/project/regenerate_embedding`,
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -203,7 +203,7 @@ export const getPersonProjectDashBoard = () => {
return httpFetch<Array<Project.PersonProjectDashboardResponseItem>>({
url:
BASE_LABEL_API + `/api/v1/label_server/data_statistics/personal_project`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -238,7 +238,7 @@ export const getCurrentPersonData = (params: { date: string }) => {
export const getProjectTypeList = () => {
return httpFetch<string[]>({
url: BASE_LABEL_API + "/api/v1/label_server/project/type_list",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -250,7 +250,7 @@ export const getProjectTypeList = () => {
export const getProjectAdminList = () => {
return httpFetch<Array<{ label: string; value: number }>>({
url: BASE_LABEL_API + "/api/v1/label_server/project/admin_list",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -262,7 +262,7 @@ export const getProjectAdminList = () => {
export const getProjectReviewers = () => {
return httpFetch<ReviewUsers>({
url: BASE_LABEL_API + "/api/v1/label_server/project/reviewer_map",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -274,7 +274,7 @@ export const getProjectReviewers = () => {
export const getSelfProjectList = () => {
return httpFetch<Array<{ label: string; value: number }>>({
url: BASE_LABEL_API + "/api/v1/label_server/project/self",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,