Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions apps/admin/src/routes/(sidebar)/images/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script lang="ts">
import { http } from '$lib/http'
import { Button } from 'flowbite-svelte'

let status: 'loading' | 'error' | 'success' | undefined

const populate = () => {
status = 'loading'
http
.post('/images/populate-image-oracle', {})
.then((res) => {
status = 'success'
})
.catch(() => {
status = 'error'
})
}
</script>

<Button on:click={populate} disabled={status === 'loading'}>Populate Image Oracle</Button>
{#if status === 'loading'}
Loading...
{:else if status === 'success'}
Success
{:else if status === 'error'}
Error, please try again
{/if}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { routeHandler } from '$lib/server/route-handler'

export const POST = async ({ locals }) => {
return routeHandler(() => locals.imageController.populateImageOracle())
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { useCookies } from '$lib/utils/cookies'
import { onMount, tick } from 'svelte'
import { derived } from 'svelte/store'
import DevMode from './DevMode.svelte'

export let data: LayoutData

Expand Down Expand Up @@ -124,6 +125,8 @@

<slot />

<DevMode />

<style lang="scss">
:global(.carousel > .item) {
padding: var(--spacing-2xl) 0;
Expand Down
Loading