update watch dock info endpoint

This commit is contained in:
smanylov
2026-06-08 13:17:23 +07:00
parent a9599d8a1f
commit 0a7d29419f
3 changed files with 6 additions and 18 deletions
+4 -17
View File
@@ -91,18 +91,11 @@ export async function requestFileAsBuffer(fileId: string): Promise<ArrayBuffer |
export async function fetchDocumentInfo(fileId: string) {
const token = await getSessionData('token');
console.log('fetchDocumentInfo');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 20005,
message_body: {
file_id: fileId,
action: 'file_info'
}
}),
const response = await fetch(`${API_BASE_URL}/api/files/public/file-info/${fileId}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
@@ -111,13 +104,7 @@ export async function fetchDocumentInfo(fileId: string) {
if (response.ok) {
const parsed = await response.json();
if (parsed.message_code === 0) {
return parsed.message_body;
} else {
return null;
}
return parsed;
} else {
throw new Error(`${response.status}`);
}