update user & reward

This commit is contained in:
Raja Oktafrianto
2025-04-12 13:27:16 +07:00
parent 4afc55952f
commit a44bbcc77a
5 changed files with 63 additions and 68 deletions

View File

@ -58,7 +58,9 @@ const EditDialog = () => {
const RewardType = {
'Daily Check in': 'D',
Referal: 'R'
Referal: 'R',
'Level Pro': 'P',
'Level Prioritas': 'L'
} as const;
type RewardTypeValue = (typeof RewardType)[keyof typeof RewardType];
@ -68,7 +70,7 @@ const EditDialog = () => {
e.preventDefault();
// console.log('Ini datanya:', selectedReward);
const response = await PutData(`${API_URL}/reward/update/${selectedReward?.id}`, formField);
const response = await PutData(`${API_URL}/reward/update/${selectedReward}`, formField);
if (response?.status) {
resetForm();
@ -126,7 +128,7 @@ const EditDialog = () => {
useEffect(() => {
if (selectedReward) {
doFetchData(selectedReward.id.toString());
doFetchData(selectedReward);
}
}, [selectedReward]);