-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from Ureca-Dangdang-salon/develop
배포 테스트
- Loading branch information
Showing
72 changed files
with
4,270 additions
and
1,353 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/* /index.html 200 | ||
/* /index.html 200 | ||
|
||
https://dangdangsalon.netlify.app/* https://client.dangdang-salon.com/:s 301! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
self.importScripts( | ||
'https://www.gstatic.com/firebasejs/9.20.0/firebase-app-compat.js' | ||
); | ||
self.importScripts( | ||
'https://www.gstatic.com/firebasejs/9.20.0/firebase-messaging-compat.js' | ||
); | ||
|
||
const firebaseConfig = { | ||
apiKey: 'AIzaSyDV1rn-AOUbRKnUrlZTWxs7DRmpLd7ZfY0', | ||
authDomain: 'dangdangsalon-50432.firebaseapp.com', | ||
projectId: 'dangdangsalon-50432', | ||
storageBucket: 'dangdangsalon-50432.firebasestorage.app', | ||
messagingSenderId: '441665534881', | ||
appId: '1:441665534881:web:442db19619f35ba4f6a9e0', | ||
measurementId: 'G-23L8ZGFYT0', | ||
}; | ||
|
||
firebase.initializeApp(firebaseConfig); | ||
|
||
const messaging = firebase.messaging(); | ||
|
||
messaging.onBackgroundMessage((payload) => { | ||
console.log('Background message received:', payload); | ||
|
||
const notificationTitle = payload.notification.title || 'Default Title'; | ||
const notificationOptions = { | ||
body: payload.notification.body || 'Default Body', | ||
icon: payload.notification.icon || '/default-icon.png', | ||
}; | ||
|
||
self.registration.showNotification(notificationTitle, notificationOptions); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import axios from 'axios'; | ||
import { handleError } from './handleError'; | ||
|
||
export const apiClient = axios.create({ | ||
baseURL: import.meta.env.VITE_BASE_URL, | ||
withCredentials: true, | ||
}); | ||
|
||
apiClient.interceptors.response.use((response) => { | ||
return response; | ||
}, handleError); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { apiClient } from './apiClient'; | ||
import { ContestController } from './requestUrls'; | ||
|
||
export const getContestRanking = async () => { | ||
try { | ||
const { data } = await apiClient.get(ContestController.rank); | ||
return data.response || false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { apiClient } from './apiClient'; | ||
|
||
export const fetchCurrentContest = async () => { | ||
try { | ||
const { data } = await apiClient.get('/api/contests'); | ||
return data.response; | ||
} catch (error) { | ||
console.error(error); | ||
return null; | ||
} | ||
}; | ||
|
||
export const fetchContestDetails = async (contestId) => { | ||
try { | ||
const { data } = await apiClient.get(`/api/contests/${contestId}`); | ||
return data.response; | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
}; | ||
|
||
export const fetchContestPayments = async (startDate, endDate) => { | ||
try { | ||
const { data } = await apiClient.post('/api/contests/payment', { | ||
startDate, | ||
endDate, | ||
}); | ||
return data.response; | ||
} catch (error) { | ||
console.error(error); | ||
return []; | ||
} | ||
}; | ||
|
||
export const postContestEntry = async (data) => { | ||
try { | ||
const res = await apiClient.post('/api/posts', data); | ||
return res.response; | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
}; | ||
|
||
export const checkContestParticipation = async (contestId) => { | ||
try { | ||
const { data } = await apiClient.get(`/api/contests/${contestId}/check`); | ||
return data.response; | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
}; | ||
|
||
export const getContestPosts = async (contestId, page, size) => { | ||
try { | ||
const { data } = await apiClient.get(`/api/contests/${contestId}/posts`, { | ||
params: { page, size }, | ||
}); | ||
return data.response; | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
}; | ||
|
||
export const deletePost = async (postId) => { | ||
try { | ||
const { data } = await apiClient.delete(`/api/posts/${postId}`); | ||
return data.response; | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
}; | ||
|
||
export const likePost = async (postId) => { | ||
const { data } = await apiClient.post(`/api/posts/${postId}/like`); | ||
return data.response; | ||
}; | ||
|
||
export const unlikePost = async (postId) => { | ||
const { data } = await apiClient.delete(`/api/posts/${postId}/like`); | ||
return data.response; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { apiClient } from './apiClient'; | ||
import { ProfileController } from './requestUrls'; | ||
|
||
export const dogProfile = async (id) => { | ||
try { | ||
const url = `${ProfileController.dogProfile}/${id}`; | ||
const { data } = await apiClient.get(url); | ||
console.log(data); | ||
return data.response; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const postDogProfile = async (petInfo) => { | ||
try { | ||
const { data } = await apiClient.post(ProfileController.dogProfile, { | ||
name: petInfo.name, | ||
profileImage: petInfo.profileImage, | ||
species: petInfo.species, | ||
ageYear: petInfo.ageYear, | ||
ageMonth: petInfo.ageMonth, | ||
gender: petInfo.gender, | ||
neutering: petInfo.neutering, | ||
weight: petInfo.weight, | ||
featureIds: petInfo.featureIds, | ||
additionalFeature: petInfo.additionalFeature, | ||
}); | ||
if (data.response === '반려견 프로필 등록이 완료되었습니다.') return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const updateDogProfile = async ( | ||
newData, | ||
id, | ||
featureIds, | ||
additionalFeature | ||
) => { | ||
try { | ||
const url = `${ProfileController.dogProfile}/${id}`; | ||
const { data } = await apiClient.put(url, { | ||
name: newData.name, | ||
profileImage: newData.profileImage, | ||
species: newData.species, | ||
ageYear: newData.ageYear, | ||
ageMonth: newData.ageMonth, | ||
gender: newData.gender, | ||
neutering: newData.neutering, | ||
weight: newData.weight, | ||
featureIds: featureIds, | ||
additionalFeature: additionalFeature, | ||
}); | ||
if (data.response === '반려견 프로필 수정이 완료되었습니다.') return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const deleteDogProfile = async (id) => { | ||
try { | ||
const url = `${ProfileController.dogProfile}/${id}`; | ||
const { data } = await apiClient.delete(url); | ||
if (data.response === '반려견 프로필 삭제가 완료되었습니다.') return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import { apiClient } from './apiClient'; | ||
import { ProfileController } from './requestUrls'; | ||
|
||
export const groomerProfile = async () => { | ||
try { | ||
const { data } = await apiClient.get(ProfileController.groomerProfile); | ||
return data.response.groomerProfile; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const postGroomerProfile = async (groomerInfo) => { | ||
try { | ||
const { data } = await apiClient.post(ProfileController.groomerProfile, { | ||
name: groomerInfo.name, | ||
phone: groomerInfo.phone, | ||
contactHours: groomerInfo.contactHours, | ||
serviceType: groomerInfo.serviceType, | ||
servicesOfferedId: groomerInfo.servicesOfferedId, | ||
servicesDistrictIds: groomerInfo.servicesDistrictIds, | ||
}); | ||
if (data.response === '미용사 프로필 등록이 완료되었습니다.') return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const postAddGroomerProfile = async (businessInfo) => { | ||
try { | ||
const { data } = await apiClient.post( | ||
ProfileController.detailGroomerProfile, | ||
{ | ||
imageKey: businessInfo.imageKey, | ||
businessNumber: businessInfo.businessNumber, | ||
address: businessInfo.address, | ||
experience: businessInfo.experience, | ||
certifications: businessInfo.certifications, | ||
description: businessInfo.description, | ||
startMessage: businessInfo.startMessage, | ||
faq: businessInfo.faq, | ||
} | ||
); | ||
if (data.response === '미용사 프로필 상세 정보 등록이 완료되었습니다.') | ||
return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const groomerPublicProfile = async (id) => { | ||
try { | ||
const url = `${ProfileController.groomerProfile}/${id}`; | ||
const { data } = await apiClient.get(url); | ||
return data.response; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const updateGroomerProfile = async (newData) => { | ||
try { | ||
const url = `${ProfileController.groomerProfile}/${newData.profileId}`; | ||
const { data } = await apiClient.put(url, { | ||
imageKey: newData.imageKey, | ||
name: newData.name, | ||
phone: newData.phone, | ||
servicesDistrictIds: newData.servicesDistrictIds, | ||
contactHours: newData.contactHours, | ||
servicesOfferedId: newData.servicesOfferedId, | ||
serviceType: newData.serviceType, | ||
businessNumber: newData.businessNumber, | ||
address: newData.address, | ||
experience: newData.experience, | ||
certifications: newData.certifications, | ||
description: newData.description, | ||
startMessage: newData.startMessage, | ||
faq: newData.faq, | ||
}); | ||
if (data.response === '미용사 프로필 수정이 완료되었습니다.') return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; | ||
|
||
export const deleteGroomerProfile = async (id) => { | ||
try { | ||
const url = `${ProfileController.groomerProfile}/${id}`; | ||
const { data } = await apiClient.delete(url); | ||
if (data.response === '미용사 프로필 삭제가 완료되었습니다.') return true; | ||
else return false; | ||
} catch (e) { | ||
console.log(e); | ||
return false; | ||
} | ||
}; |
Oops, something went wrong.