Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #109

Merged
merged 3 commits into from
Sep 9, 2024
Merged

Dev #109

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix : packages matched
sw326 committed Sep 9, 2024
commit 72fe098a6ca1143803b490ceb1bdbceb685cc797
576 changes: 449 additions & 127 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@reduxjs/toolkit": "^2.2.6",
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-query-devtools": "^5.51.21",
"@types/react": "^18.3.3",
@@ -55,12 +54,9 @@
"react-bootstrap": "^2.10.4",
"react-id-generator": "^3.0.2",
"react-modal": "^3.16.1",
"react-redux": "^9.1.2",
"react-router-dom": "^6.25.1",
"redux": "^5.0.1",
"styled-components": "^6.1.12",
"tailwindcss": "^3.4.6",
"vite": "^5.3.4",
"zustand": "^4.5.4"
"vite": "^5.3.4"
}
}
}
2 changes: 1 addition & 1 deletion src/components/common/EmailVerification.tsx
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ const EmailVerification: React.FC<EmailVerificationProps> = ({
setIsVerified(true);
onVerificationComplete(true);
setError('');
showErrorNotification('이메일이 성공적으로 인증되었습니다.');
toast.success('이메일이 성공적으로 인증되었습니다.');
} catch (error) {
const errorMessage = handleApiError(error);
showErrorNotification(errorMessage);
35 changes: 22 additions & 13 deletions src/pages/members/CommissionEdit.tsx
Original file line number Diff line number Diff line change
@@ -4,7 +4,11 @@ import {
useCommissionConfirmed,
useUpdateCommission,
} from '../../hooks/useCommissions';
import { Commission, HouseTypeKorean, CleanTypeKorean } from '../../types/commission';
import {
Commission,
HouseTypeKorean,
CleanTypeKorean,
} from '../../types/commission';
import { toast } from 'react-hot-toast';
import { showErrorNotification } from '../../utils/errorHandler';
import { Save, ArrowLeft } from 'lucide-react';
@@ -27,7 +31,12 @@ const CommissionEdit: React.FC = () => {

useEffect(() => {
if (commission) {
setEditedCommission(commission);
setEditedCommission({
...commission,
desiredDate: commission.desiredDate
? new Date(commission.desiredDate).toISOString().slice(0, 16)
: '',
});
}
}, [commission]);

@@ -37,7 +46,7 @@ const CommissionEdit: React.FC = () => {
>,
) => {
const { name, value } = e.target;
setEditedCommission((prev) => ({ ...prev, [name]: value }));
setEditedCommission(prev => ({ ...prev, [name]: value }));
};

const handleSubmit = async (e: React.FormEvent) => {
@@ -46,10 +55,16 @@ const CommissionEdit: React.FC = () => {
if (!editedCommission.commissionId || !editedCommission.addressId) {
throw new Error('Invalid commissionId or addressId');
}
const updatedCommission = {
...editedCommission,
desiredDate: new Date(
editedCommission.desiredDate as string,
).toISOString(),
};
await updateCommissionMutation.mutateAsync({
commissionId: editedCommission.commissionId,
addressId: editedCommission.addressId,
commission: editedCommission,
commission: updatedCommission,
});
toast.success('의뢰가 성공적으로 수정되었습니다');
navigate(`/commissiondetail?commissionId=${commissionId}`);
@@ -155,19 +170,13 @@ const CommissionEdit: React.FC = () => {
htmlFor="desiredDate"
className="block text-sm font-medium text-gray-700 mb-1"
>
희망 날짜
희망 날짜 및 시간
</label>
<input
type="date"
type="datetime-local"
id="desiredDate"
name="desiredDate"
value={
editedCommission.desiredDate
? new Date(editedCommission.desiredDate)
.toISOString()
.split('T')[0]
: ''
}
value={editedCommission.desiredDate || ''}
onChange={handleChange}
className="w-full p-2 border border-gray-300 rounded-md focus:ring-brand focus:border-brand"
required
366 changes: 58 additions & 308 deletions yarn.lock

Large diffs are not rendered by default.