We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86619b7 commit 8e0b339Copy full SHA for 8e0b339
src/containers/my-cooperations/cooperation-notes/CooperationNotes.tsx
@@ -145,7 +145,11 @@ const CooperationNotes: React.FC = () => {
145
const duplicateNote = (noteId: string) => {
146
const note = notes?.find((item) => item._id === noteId)
147
148
- return CooperationNotesService.createNote(note!, cooperationId)
+ if (!note) {
149
+ throw new Error('Note with specified ID was not found')
150
+ }
151
+
152
+ return CooperationNotesService.createNote(note, cooperationId)
153
}
154
155
const { mutate: duplicateItem } = useMutation({
0 commit comments