perf: DT detaylari 10 paralel + adaptif fren (0.36 -> 3.2 kayit/sn) & feat: EKAP'tan inen dokumani ihaleye yukleme

This commit is contained in:
2026-08-30 14:07:29 +03:00
parent c5662d2e60
commit 40fea290e4
5 changed files with 183 additions and 29 deletions
+6 -2
View File
@@ -20,6 +20,10 @@ async function iste(url, opts = {}) {
// --- Plan & kota ---
export const getPlan = () => iste('/api/me/plan');
/** Belirli bir ihaleye yüklenmiş belgeler */
export const listTenderDocuments = (ikn) =>
iste(`/api/me/documents?ikn=${encodeURIComponent(ikn)}`).then((d) => d.belgeler || []);
// --- Kullanıcı verisi ---
export const getAllUserData = () => iste('/api/me/data').then((d) => d.veri || {});
export const setUserData = (anahtar, deger) =>
@@ -34,7 +38,7 @@ export const revokeApiKey = (id) => iste(`/api/me/apikeys?id=${encodeURIComponen
export const listDocuments = () => iste('/api/me/documents');
export const deleteDocument = (id) => iste(`/api/me/documents?id=${encodeURIComponent(id)}`, { method: 'DELETE' });
export async function uploadDocument(file, kategori) {
export async function uploadDocument(file, kategori, ikn) {
const icerikBase64 = await new Promise((resolve, reject) => {
const r = new FileReader();
r.onload = () => resolve(String(r.result).split(',')[1]);
@@ -43,7 +47,7 @@ export async function uploadDocument(file, kategori) {
});
return iste('/api/me/documents', {
method: 'POST',
body: JSON.stringify({ ad: file.name, mime: file.type, kategori, icerikBase64 }),
body: JSON.stringify({ ad: file.name, mime: file.type, kategori, ikn, icerikBase64 }),
});
}