Skip to content
Snippets Groups Projects
Commit 43535e7b authored by 석찬 윤's avatar 석찬 윤
Browse files

Merge branch 'develop' into 'main'

fix: meetin api method 및 credentials 수정

See merge request !50
parents 3e65d8ca 94d44041
No related branches found
No related tags found
1 merge request!50fix: meetin api method 및 credentials 수정
Pipeline #11021 passed
...@@ -11,6 +11,7 @@ export const getAllMeetings = async (page = 0, size = 20) => { ...@@ -11,6 +11,7 @@ export const getAllMeetings = async (page = 0, size = 20) => {
const response = await fetch( const response = await fetch(
`${BASE_URL}/api/meeting?page=${page}&size=${size}`, `${BASE_URL}/api/meeting?page=${page}&size=${size}`,
{ {
credentials: "include", // Include credentials for session-based authentication
method: "GET", method: "GET",
} }
); );
...@@ -29,6 +30,7 @@ export const getAllMeetings = async (page = 0, size = 20) => { ...@@ -29,6 +30,7 @@ export const getAllMeetings = async (page = 0, size = 20) => {
*/ */
export const getMeetingDetails = async (meetingId) => { export const getMeetingDetails = async (meetingId) => {
const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}`, { const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}`, {
credentials: "include",
method: "GET", method: "GET",
}); });
...@@ -46,6 +48,7 @@ export const getMeetingDetails = async (meetingId) => { ...@@ -46,6 +48,7 @@ export const getMeetingDetails = async (meetingId) => {
*/ */
export const createMeeting = async (meetingData) => { export const createMeeting = async (meetingData) => {
const response = await fetch(`${BASE_URL}/api/meeting`, { const response = await fetch(`${BASE_URL}/api/meeting`, {
credentials: "include",
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
...@@ -67,6 +70,7 @@ export const createMeeting = async (meetingData) => { ...@@ -67,6 +70,7 @@ export const createMeeting = async (meetingData) => {
*/ */
export const joinMeeting = async (meetingId) => { export const joinMeeting = async (meetingId) => {
const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}/join`, { const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}/join`, {
credentials: "include",
method: "POST", method: "POST",
}); });
...@@ -87,6 +91,7 @@ export const getMyMeetings = async (page = 0, size = 20) => { ...@@ -87,6 +91,7 @@ export const getMyMeetings = async (page = 0, size = 20) => {
const response = await fetch( const response = await fetch(
`${BASE_URL}/api/meeting/my?page=${page}&size=${size}`, `${BASE_URL}/api/meeting/my?page=${page}&size=${size}`,
{ {
credentials: "include",
method: "GET", method: "GET",
} }
); );
...@@ -105,7 +110,8 @@ export const getMyMeetings = async (page = 0, size = 20) => { ...@@ -105,7 +110,8 @@ export const getMyMeetings = async (page = 0, size = 20) => {
*/ */
export const leaveMeeting = async (meetingId) => { export const leaveMeeting = async (meetingId) => {
const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}/leave`, { const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}/leave`, {
method: "POST", credentials: "include",
method: "DELETE",
}); });
if (!response.ok) { if (!response.ok) {
...@@ -122,6 +128,7 @@ export const leaveMeeting = async (meetingId) => { ...@@ -122,6 +128,7 @@ export const leaveMeeting = async (meetingId) => {
*/ */
export const closeMeeting = async (meetingId) => { export const closeMeeting = async (meetingId) => {
const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}/close`, { const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}/close`, {
credentials: "include",
method: "PUT", method: "PUT",
}); });
...@@ -132,8 +139,14 @@ export const closeMeeting = async (meetingId) => { ...@@ -132,8 +139,14 @@ export const closeMeeting = async (meetingId) => {
return await response.json(); return await response.json();
}; };
/**
* 미팅 삭제
* @param {number} meetingId - 삭제할 미팅 ID
* @returns {Promise<Object>} - 삭제 결과 메시지
*/
export const deleteMeeting = async (meetingId) => { export const deleteMeeting = async (meetingId) => {
const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}`, { const response = await fetch(`${BASE_URL}/api/meeting/${meetingId}`, {
credentials: "include",
method: "DELETE", method: "DELETE",
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment