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