fix: persist tender preparation and correct calendar export
This commit is contained in:
@@ -1061,6 +1061,20 @@ const server = http.createServer(async (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (url.pathname === '/api/me/tender-state') {
|
||||
const user = userFromAuthHeader(req.headers['authorization']);
|
||||
if (!user) return json(res, 401, { success: false, error: 'oturum yok' });
|
||||
if (req.method === 'GET') return json(res, 200, {success:true, records:store.getTenderStates(user.email)});
|
||||
if (req.method !== 'PUT') return json(res, 405, {success:false,error:'desteklenmeyen metot'});
|
||||
try {
|
||||
const body = await readBody(req, 512 * 1024);
|
||||
const record = store.saveTenderState(user.email, body.key, body.patch, body.snapshot, body.version);
|
||||
return json(res, 200, {success:true, record});
|
||||
} catch (e) {
|
||||
return json(res, e.kod === 'VERSION_CONFLICT' ? 409 : 400, {success:false,error:e.message,kod:e.kod});
|
||||
}
|
||||
}
|
||||
|
||||
// --- Kullanıcı verisi (localStorage yerine sunucu tarafı) ---
|
||||
if (url.pathname.startsWith('/api/me/data')) {
|
||||
const user = userFromAuthHeader(req.headers['authorization']);
|
||||
|
||||
Reference in New Issue
Block a user