Skip to content

Commit

Permalink
test new data table update
Browse files Browse the repository at this point in the history
  • Loading branch information
birdpump committed Apr 13, 2024
1 parent 2dd1b1c commit 902da90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/routes/(admin)/admin/edit/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import LockerEdit from "./views/LockerEdit.svelte";
import UserEdit from "./views/UserEdit.svelte";
let selected = UserEdit;
let selected = LockerEdit;
</script>
Expand Down
34 changes: 17 additions & 17 deletions src/routes/(admin)/admin/edit/views/UserEdit.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<script>
import Grid from "gridjs-svelte";
import { h } from "gridjs";
import {h} from "gridjs";
import Modal from '../Editmodal.svelte';
import { onMount } from 'svelte';
import { fetchUserData } from "$lib/services/admin/mainApi.js";
import {onMount} from 'svelte';
import '$lib/assets/admin-table.css'
import {fetchUserData} from "$lib/services/admin/mainApi.js";
let showModal = false;
let data;
function launchEdit(id){
function launchEdit(id) {
console.log("all")
showModal = true;
}
Expand Down Expand Up @@ -37,12 +38,12 @@
'border-right': 'none',
'text-align': 'center'
},
footer:{
footer: {
'color': '#d6d6d6',
'background-color': '#18181b',
'border-top': 'none',
},
header:{
header: {
padding: '0px',
border: 'none'
}
Expand Down Expand Up @@ -95,17 +96,16 @@
<div class="modal-cont">
<Modal bind:showModal/>
</div>
{#await data}
<p>Loading...</p>
{:then userData}
<Grid
search
<Grid
{columns}
pagination={{ enabled: true, limit: 11 }}
search
server={{
url: 'https://locker-api.cvapps.net/admin/data/user-data?page=1&pageSize=1',
then: data => data.results.map(movie => {
return [movie[0], movie[1], movie[2], movie[3]]
})
}}
{style}
{columns}
{userData}
/>
{:catch error}
<p>Error fetching data: {error.message}</p>
{/await}
/>
</div>

0 comments on commit 902da90

Please sign in to comment.