Setting attachment thumbnail

This commit is contained in:
2024-12-26 00:02:25 +08:00
parent 168d51c9fe
commit 619c90cdd9
5 changed files with 231 additions and 76 deletions

View File

@ -215,4 +215,18 @@ class SnAttachmentProvider {
return place;
}
Future<SnAttachment> updateOne(
int id,
String alt, {
required Map<String, dynamic> metadata,
bool isMature = false,
}) async {
final resp = await _sn.client.put('/cgi/uc/attachments/$id', data: {
'alt': alt,
'metadata': metadata,
'is_mature': isMature,
});
return SnAttachment.fromJson(resp.data);
}
}