✨ Allow user blocking publisher's user and report it
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/account.dart';
|
||||
|
||||
class SnRelationshipProvider {
|
||||
late final SnNetworkProvider _sn;
|
||||
@ -9,6 +10,15 @@ class SnRelationshipProvider {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
}
|
||||
|
||||
Future<SnRelationship?> getRelationship(int relatedId) async {
|
||||
try {
|
||||
final resp = await _sn.client.get('/cgi/id/users/me/relations/$relatedId');
|
||||
return SnRelationship.fromJson(resp.data);
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateRelationship(
|
||||
int relatedId,
|
||||
int status,
|
||||
|
Reference in New Issue
Block a user