mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-22 19:51:11 +08:00
show reserve btn in space page
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -571,4 +571,23 @@ abstract final class UserHttp {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<void>> spaceReserve({
|
||||
required Object sid,
|
||||
required bool isFollow,
|
||||
}) async {
|
||||
final res = await Request().post(
|
||||
isFollow ? Api.spaceReserveCancel : Api.spaceReserve,
|
||||
data: {
|
||||
'sid': sid,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return const Success(null);
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user