47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
import request from "@/utils/request";
|
|
|
|
export const getShootingList = (params = {}) =>
|
|
request({ url: "/shooting/", method: "GET", data: params });
|
|
|
|
export const getMyShootings = (params = {}) =>
|
|
request({ url: "/shooting/mine", method: "GET", data: params });
|
|
|
|
export const getMyApplications = (params = {}) =>
|
|
request({ url: "/shooting/my-applications", method: "GET", data: params });
|
|
|
|
export const getShootingDetail = (id) =>
|
|
request({ url: `/shooting/${id}`, method: "GET" });
|
|
|
|
export const createShooting = (data) =>
|
|
request({ url: "/shooting/", method: "POST", data });
|
|
|
|
export const updateShooting = (id, data) =>
|
|
request({ url: `/shooting/${id}`, method: "PUT", data });
|
|
|
|
export const closeShooting = (id) =>
|
|
request({ url: `/shooting/${id}/close`, method: "POST" });
|
|
|
|
export const applyToShooting = (id, data = {}) =>
|
|
request({ url: `/shooting/${id}/apply`, method: "POST", data });
|
|
|
|
export const getApplications = (id) =>
|
|
request({ url: `/shooting/${id}/applications`, method: "GET" });
|
|
|
|
export const acceptApplication = (requestId, appId) =>
|
|
request({
|
|
url: `/shooting/${requestId}/applications/${appId}/accept`,
|
|
method: "POST",
|
|
});
|
|
|
|
export const rejectApplication = (requestId, appId) =>
|
|
request({
|
|
url: `/shooting/${requestId}/applications/${appId}/reject`,
|
|
method: "POST",
|
|
});
|
|
|
|
export const withdrawApplication = (requestId) =>
|
|
request({
|
|
url: `/shooting/${requestId}/applications/withdraw`,
|
|
method: "DELETE",
|
|
});
|