Skip to content

Commit

Permalink
fix : 데이트피커 불가능 날짜 비활성와 완료 (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangminguu authored Nov 7, 2024
1 parent 98d029d commit 5434c85
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/widgets/write-diary/ui/WriteDiaryContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DatePicker } from '@/widgets/date-picker';
import { DiaryVisibilityControls } from '@/widgets/diary-visibility-controls';
import { setDateFormat } from '@/widgets/date-picker/ui/setDateFormat';
import { useNavigate, useParams } from 'react-router-dom';
import { useAuthStore } from '@/features/login/hooks/useAuthStore';
import { EditLabel } from '@/entities/label/ui/EditLabel';

export const WriteDiaryContainer: React.FC<WriteDiaryContainerProps> = ({
Expand Down Expand Up @@ -63,13 +64,14 @@ export const WriteDiaryContainer: React.FC<WriteDiaryContainerProps> = ({
return `${year}-${month}-${day}`;
};

const userEmail = '[email protected]'; // 샘플 계정
const { email } = useAuthStore();
const url = process.env.REACT_APP_API_URL;

useEffect(() => {
const fetchDisabledDates = async () => {
try {
const response = await fetch(
`https://td3axvf8x7.execute-api.ap-northeast-2.amazonaws.com/moodi/diary?limit=40&user_email=${userEmail}`
`${url}/diary?user_email=${email}`
); // @ API 호출
const data = await response.json();
const dates = data.diaries.map(
Expand Down

0 comments on commit 5434c85

Please sign in to comment.