refactor: Update API request in ActivityComplete.svelte and add adventure search button in +page.svelte
This commit is contained in:
@@ -11,8 +11,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
let res = await fetch('/api/activity-types/types/');
|
let res = await fetch('/api/activity-types/types/', {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
});
|
||||||
let data = await res.json();
|
let data = await res.json();
|
||||||
|
console.log('ACTIVITIES' + data);
|
||||||
if (data) {
|
if (data) {
|
||||||
allActivities = data;
|
allActivities = data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
@@ -19,12 +20,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{activity}</td>
|
<td>{activity}</td>
|
||||||
<td>
|
<td>
|
||||||
<!-- <button
|
<button
|
||||||
class="btn btn-sm btn-error"
|
class="btn btn-sm btn-primary"
|
||||||
on:click={() => {
|
on:click={() => goto(`/search?query=${activity}&property=activity_types`)}
|
||||||
activities = activities.filter((a) => a !== activity);
|
>See Adventures</button
|
||||||
}}>Remove</button
|
>
|
||||||
> -->
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
Reference in New Issue
Block a user