feat(mvp): complete M13 clean-up milestone (real usernames, avatar studio redesign, pause menu, audio manager)
checkpoint / checkpoint (push) Successful in 6m22s
checkpoint / checkpoint (push) Successful in 6m22s
This commit is contained in:
@@ -11,8 +11,18 @@ static func get_api_client(node: Node) -> Node:
|
||||
|
||||
# ── Friends & Follow & Block ──
|
||||
|
||||
static func send_friend_request(api: Node, user_id: int) -> Dictionary:
|
||||
return await api.request(HTTPClient.METHOD_POST, "/api/friends/requests", JSON.stringify({"user_id": user_id}), "application/json", true)
|
||||
static func send_friend_request(api: Node, target: Variant) -> Dictionary:
|
||||
var payload: Dictionary = {}
|
||||
if target is int:
|
||||
payload = {"user_id": target}
|
||||
elif target is String:
|
||||
if (target as String).is_valid_int():
|
||||
payload = {"user_id": int(target)}
|
||||
else:
|
||||
payload = {"username": (target as String).strip_edges()}
|
||||
else:
|
||||
payload = {"user_id": int(target)}
|
||||
return await api.request(HTTPClient.METHOD_POST, "/api/friends/requests", JSON.stringify(payload), "application/json", true)
|
||||
|
||||
static func get_friend_requests(api: Node) -> Dictionary:
|
||||
return await api.request(HTTPClient.METHOD_GET, "/api/friends/requests", "", "application/json", true)
|
||||
|
||||
Reference in New Issue
Block a user