show reserve btn in space page

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-05 12:10:18 +08:00
parent c0b55f9af3
commit 3ec54868d0
6 changed files with 304 additions and 1 deletions

View File

@@ -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']);
}
}
}