done
This commit is contained in:
parent
ee1510a420
commit
f3cc7c6d9e
@ -70,8 +70,16 @@ $(document).ready(function() {
|
||||
url: '/helper/get/getRegistrasis',
|
||||
data: { search: query },
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
|
||||
if (response.error === 0 && Array.isArray(response.data)) {
|
||||
callback(response.data);
|
||||
const dataMapped = response.data.map(item => ({
|
||||
uid: item.uid,
|
||||
name: item.patient?.name ?? '-', // kasih nama supaya Selectize bisa tampil
|
||||
created_at: item.created_at
|
||||
}));
|
||||
callback(dataMapped);
|
||||
|
||||
} else {
|
||||
callback([]);
|
||||
}
|
||||
@ -84,6 +92,8 @@ $(document).ready(function() {
|
||||
render: {
|
||||
option: function(item, escape) {
|
||||
// Format tanggal created_at
|
||||
console.log(item);
|
||||
|
||||
let createdAt = '-';
|
||||
if (item.created_at) {
|
||||
const date = new Date(item.created_at);
|
||||
@ -94,7 +104,7 @@ $(document).ready(function() {
|
||||
return `
|
||||
<div class="p-1">
|
||||
<div class="fw-semibold" style="font-size: 0.9rem;">
|
||||
${escape(item.patient?.name || '')}
|
||||
${escape(item?.name || '')}
|
||||
</div>
|
||||
<div style="font-size: 0.75rem; color: gray;">
|
||||
Tanggal Registrasi: ${escape(createdAt)}
|
||||
@ -111,7 +121,7 @@ $(document).ready(function() {
|
||||
|
||||
return `
|
||||
<div>
|
||||
${escape(item.patient?.name || '')} (${escape(createdAt)})
|
||||
${escape(item.name || '')} (${escape(createdAt)})
|
||||
</div>`;
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user