updateDocument method
Updates document metadata (title, slug, isDefault). To update document data, use createDocumentVersion instead.
documentId - The ID of the document to update
title - Optional new title
slug - Optional new slug
isDefault - Optional new default status
Returns the updated DeskDocument, or null if the document was not found.
Throws DeskDataSourceException if the operation fails. Throws DeskAuthenticationException if authentication is required.
Implementation
@override
Future<DeskDocument?> updateDocument(
String documentId, {
String? title,
String? slug,
bool? isDefault,
}) async {
final doc = _documents[documentId];
if (doc == null) return null;
_documents[documentId] = doc.copyWith(
title: title ?? doc.title,
slug: slug ?? doc.slug,
isDefault: isDefault ?? doc.isDefault,
updatedAt: DateTime.now(),
);
return _documents[documentId];
}