Numex yayın: models/lokasyon.js
This commit is contained in:
parent
93a5b3742e
commit
4666abf772
19
models/lokasyon.js
Normal file
19
models/lokasyon.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Lokasyon (depo / şube) modeli
|
||||||
|
const store = require('./store');
|
||||||
|
|
||||||
|
// Geçerli lokasyon mu kontrol et
|
||||||
|
function dogrula(veri) {
|
||||||
|
const hatalar = [];
|
||||||
|
if (!veri.ad || veri.ad.trim() === '') hatalar.push('Lokasyon adı zorunludur');
|
||||||
|
return hatalar;
|
||||||
|
}
|
||||||
|
|
||||||
|
function tumu() {
|
||||||
|
return store.oku('lokasyonlar');
|
||||||
|
}
|
||||||
|
|
||||||
|
function bul(id) {
|
||||||
|
return store.bulKoleksiyonda('lokasyonlar', Number(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { dogrula, tumu, bul };
|
||||||
Loading…
Reference in New Issue
Block a user