add relasi villa dan employee ke timesheet
This commit is contained in:
@@ -129,12 +129,12 @@
|
|||||||
|
|
||||||
type Villa = {
|
type Villa = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
villa_name: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type User = {
|
type User = {
|
||||||
id: string;
|
id: string;
|
||||||
full_name: string;
|
employee_name: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
let dataVilla: Villa[] = [];
|
let dataVilla: Villa[] = [];
|
||||||
@@ -142,8 +142,8 @@
|
|||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const { data, error } = await supabase
|
const { data, error } = await supabase
|
||||||
.from("villas")
|
.from("vb_villas")
|
||||||
.select("id, name");
|
.select("id, villa_name");
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error("Error fetching villas:", error);
|
console.error("Error fetching villas:", error);
|
||||||
@@ -152,8 +152,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { data: userData, error: userError } = await supabase
|
const { data: userData, error: userError } = await supabase
|
||||||
.from("vb_users")
|
.from("vb_employee")
|
||||||
.select("id, full_name");
|
.select("id, employee_name");
|
||||||
if (userError) {
|
if (userError) {
|
||||||
console.error("Error fetching users:", userError);
|
console.error("Error fetching users:", userError);
|
||||||
} else if (userData) {
|
} else if (userData) {
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
>Select option...</option
|
>Select option...</option
|
||||||
>
|
>
|
||||||
{#each dataVilla as villa}
|
{#each dataVilla as villa}
|
||||||
<option value={villa.id}>{villa.name}</option>
|
<option value={villa.id}>{villa.villa_name}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
{#if $formErrors.villa_name}
|
{#if $formErrors.villa_name}
|
||||||
@@ -454,7 +454,7 @@
|
|||||||
>
|
>
|
||||||
{#each dataUser as reporter}
|
{#each dataUser as reporter}
|
||||||
<option value={reporter.id}>
|
<option value={reporter.id}>
|
||||||
{reporter.full_name}
|
{reporter.employee_name}
|
||||||
</option>
|
</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
@@ -591,7 +591,7 @@
|
|||||||
>Select option...</option
|
>Select option...</option
|
||||||
>
|
>
|
||||||
{#each dataUser as input}
|
{#each dataUser as input}
|
||||||
<option value={input.id}>{input.full_name}</option>
|
<option value={input.id}>{input.employee_name}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
{#if $formErrors.input_by}
|
{#if $formErrors.input_by}
|
||||||
|
|||||||
Reference in New Issue
Block a user