feat: Initial commit - WebGIS Smart City Project by Naufal Zaky Ramadhan (D1041231071)

This commit is contained in:
naukyy
2026-06-13 00:00:33 +07:00
commit 2c123f5af2
163 changed files with 13007 additions and 0 deletions
@@ -0,0 +1,28 @@
/**
* kavling.service.js
* Tanggung Jawab: Komunikasi HTTP ke endpoint API kavling.php
*/
import { CONFIG } from '../config.js';
export const kavlingService = {
getAll: async () => {
const response = await fetch(`${CONFIG.BASE_URL}/kavling.php`);
return await response.json();
},
save: async (data) => {
const response = await fetch(`${CONFIG.BASE_URL}/kavling.php`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
return await response.json();
},
delete: async (id) => {
const response = await fetch(`${CONFIG.BASE_URL}/kavling.php?id=${id}`, {
method: 'DELETE'
});
return await response.json();
}
};