(values)
| 119 | }; |
| 120 | |
| 121 | const handleSingleSubmit = async (values) => { |
| 122 | try { |
| 123 | setSubmitting(true); |
| 124 | const payload = buildSinglePayload(values); |
| 125 | if (recording && recording.id) { |
| 126 | await updateRecording(recording.id, payload); |
| 127 | showNotification({ |
| 128 | title: 'Recording updated', |
| 129 | message: 'Recording schedule updated successfully', |
| 130 | color: 'green', |
| 131 | autoClose: 2500, |
| 132 | }); |
| 133 | } else { |
| 134 | await createRecording(payload); |
| 135 | showNotification({ |
| 136 | title: 'Recording scheduled', |
| 137 | message: 'One-time recording added to DVR queue', |
| 138 | color: 'green', |
| 139 | autoClose: 2500, |
| 140 | }); |
| 141 | } |
| 142 | await fetchRecordings(); |
| 143 | handleClose(); |
| 144 | } catch (error) { |
| 145 | console.error('Failed to create recording', error); |
| 146 | } finally { |
| 147 | setSubmitting(false); |
| 148 | } |
| 149 | }; |
| 150 | |
| 151 | const handleRecurringSubmit = async (values) => { |
| 152 | try { |
nothing calls this directly
no test coverage detected