Skip to content

Commit

Permalink
REFACTOR: move to useMutation for update channel notification API (#105)
Browse files Browse the repository at this point in the history
Closes #112 

## Description
Find a list of APIs that use the method PUT/PATCH/POST and have additional conditions (success, error, etc) or need some results (isLoading, etc). APIs that have those criteria will be added a layer before accessing those APIs directly with useMutation.

## Current Tasks

APIs:
- [ ] Check the slug owner (POST)
- [ ] Update user (PATCH)
- [ ] Send question (POST)
- [ ] Add new custom og (POST)
- [ ] Update custom og (PATCH)
- [ ] Add new channel notification (POST)
- [x] Update channel notification (PATCH)
  • Loading branch information
madjiebimaa authored Oct 23, 2023
1 parent 917c626 commit 538f52b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ export const usePatchUpdateChannelNotif = () => {
description: `Berhasil menyimpan perubahan notifikasi ke Telegram!`,
})
},
onError: () => {
toast({
title: 'Gagal menyimpan',
description: `Gagal saat mencoba menyimpan data, silahkan coba beberapa saat lagi!`,
})
},
})
}

0 comments on commit 538f52b

Please sign in to comment.