Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rbx_api): replace deprecated create asset alias API with new API #221

Merged
merged 8 commits into from
Jul 10, 2024
18 changes: 8 additions & 10 deletions mantle/rbx_api/src/asset_aliases/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod models;

use reqwest::header;
use serde_json::json;

use crate::{
errors::RobloxApiResult,
Expand All @@ -21,15 +20,14 @@ impl RobloxApi {
) -> RobloxApiResult<()> {
let req = self
.client
.post(format!(
"https://develop.roblox.com/v1/universes/{}/aliases",
experience_id
))
.json(&json!({
"name": name,
"type": "1",
"targetId": asset_id,
}));
.post("https://apis.roblox.com/content-aliases-api/v1/universes/create-alias")
.header(header::CONTENT_LENGTH, 0)
.query(&[
("universeId", experience_id.to_string().as_str()),
("name", name.as_str()),
("type", "1"),
("targetId", asset_id.to_string().as_str()),
]);

handle(req).await?;

Expand Down
Loading