update user files info

This commit is contained in:
smanylov
2026-01-07 13:03:50 +07:00
parent 5597fe42a2
commit aa0f9398eb
16 changed files with 371 additions and 76 deletions
+33
View File
@@ -28,4 +28,37 @@ export async function getUserData() {
} catch (error) {
console.error('error');
}
}
export async function getUserFilesInfo() {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 20005,
message_body: {
action: "user_files_info",
token: token
}
}),
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
}
});
if (response.ok) {
const parsed = await response.json();
if (parsed.message_code === 0) {
return parsed.message_body;
} else {
throw parsed.message_code;
}
}
} catch (error) {
console.error(`error: ${error}`);
}
}