updateSegment method
Updates the given segment at the given position
Implementation
Future<void> updateSegment(int pageId, int position, Segment segment) async {
final data = segment.toJson();
if (segment.file != null) {
data['file'] = segment.file!.id;
} else if (segment.gallery != null) {
data['gallery'] = segment.gallery!.id;
}
await _put('/api/segment-page/$pageId/segment/$position', data: data);
}