try posting

This commit is contained in:
Inex Code 2022-04-21 07:33:09 +00:00
parent 6bddb2e0b8
commit ec40134563

View file

@ -135,10 +135,10 @@ Future<void> _postOnMastodon(reqJson) async {
mediaIds.add(resp.data['id']);
}
// var postResponse = await dio.post('$instanceUrl/api/v1/statuses',
// data: {'status': postText, 'media_ids': mediaIds},
// options:
// dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
var postResponse = await dio.post('$instanceUrl/api/v1/statuses',
data: {'status': postText, 'media_ids': mediaIds},
options:
dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
await Future.wait(photoUrls.map((photoUrl) => File(photoUrl).delete()));
@ -165,13 +165,13 @@ Future<void> _postOnMastodon(reqJson) async {
mediaIds.add(resp.data['id']);
}
// postResponse = await dio.post('$instanceUrl/api/v1/statuses',
// data: {
// 'in_reply_to_id': postResponse.data['id'],
// 'media_ids': mediaIds
// },
// options:
// dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
postResponse = await dio.post('$instanceUrl/api/v1/statuses',
data: {
'in_reply_to_id': postResponse.data['id'],
'media_ids': mediaIds
},
options:
dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
await Future.wait(photoUrls.map((photoUrl) => File(photoUrl).delete()));
}