refactor: rewrite ke codebase lama

This commit is contained in:
Muhammad Zhafran Ilham
2026-06-07 20:17:49 +07:00
parent ce5487dcbf
commit fe74b2213d
146 changed files with 14608 additions and 6686 deletions
+28
View File
@@ -0,0 +1,28 @@
import db from '../config/db_connection.js';
export function addhasilResearch(nama_project, deskripsi, link_project, image_path) {
const SQLQuery =
'INSERT INTO hasil_research (nama_project, deskripsi, link_project, image_path) VALUES (?,?,?,?)';
return db.execute(SQLQuery, [nama_project, deskripsi, link_project, image_path]);
}
export function gethasilResearch() {
return db.execute('SELECT * FROM hasil_research');
}
export function gethasilResearchById(id) {
return db.execute('SELECT * FROM hasil_research WHERE id = ?', [id]);
}
export function updateHasilResearch(id, nama_project, deskripsi, link_project, image_path) {
const SQLQuery = `
UPDATE hasil_research
SET nama_project = ?, deskripsi = ?, link_project = ?, image_path = ?
WHERE id = ?
`;
return db.execute(SQLQuery, [nama_project, deskripsi, link_project, image_path, id]);
}
export function deletehasilResearch(id) {
return db.execute('DELETE FROM hasil_research WHERE id = ?', [id]);
}