fix: confirm and version favorite institution updates
This commit is contained in:
+3
-1
@@ -1207,7 +1207,9 @@ const server = http.createServer(async (req, res) => {
|
||||
validateTeam(body.deger);
|
||||
kotaKontrol(user.email, 'ekip', 0, body.deger.length, { isAdmin: user.isAdmin });
|
||||
}
|
||||
const protectedKey=['firma_profil','saved_filters','ekip'].includes(k);
|
||||
if(k==='favori_kurumlar' && (!Array.isArray(body.deger) || body.deger.some(name=>typeof name!=='string'||!name.trim()||name.length>1000) || new Set(body.deger.map(name=>name.trim())).size!==body.deger.length))
|
||||
return json(res,400,{success:false,error:'Favori kurum listesi geçersiz veya yinelenen kurum içeriyor.'});
|
||||
const protectedKey=['firma_profil','saved_filters','ekip','favori_kurumlar'].includes(k);
|
||||
if(protectedKey && (!Object.hasOwn(body,'revision') || (body.revision!==null && (typeof body.revision!=='string' || !/^[a-f0-9]{64}$/.test(body.revision)))))
|
||||
return json(res,428,{success:false,kod:'VERSION_REQUIRED',error:'Güncel kayıt sürümü gerekli. Sayfayı yenileyip tekrar deneyin.'});
|
||||
const revision=store.setData(user.email, k, body.deger, protectedKey ? body.revision : undefined);
|
||||
|
||||
Reference in New Issue
Block a user