Refactor user ID handling to use UUIDs; update related components and serializers for consistency
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
console.log(data);
|
||||
|
||||
let adventures: Adventure[] = data.props.adventures || [];
|
||||
let categories: Category[] = data.props.categories || [];
|
||||
|
||||
let currentSort = {
|
||||
order_by: '',
|
||||
@@ -36,14 +35,13 @@
|
||||
let typeString: string = '';
|
||||
|
||||
$: {
|
||||
console.log(typeString);
|
||||
if (typeof window !== 'undefined' && typeString) {
|
||||
if (typeof window !== 'undefined') {
|
||||
let url = new URL(window.location.href);
|
||||
url.searchParams.set('types', typeString);
|
||||
goto(url.toString(), { invalidateAll: true, replaceState: true });
|
||||
} else if (typeof window !== 'undefined' && !typeString) {
|
||||
let url = new URL(window.location.href);
|
||||
url.searchParams.set('types', 'all');
|
||||
if (typeString) {
|
||||
url.searchParams.set('types', typeString);
|
||||
} else {
|
||||
url.searchParams.delete('types');
|
||||
}
|
||||
goto(url.toString(), { invalidateAll: true, replaceState: true });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{/if}
|
||||
|
||||
{#if adventure}
|
||||
{#if data.user && data.user.pk == adventure.user_id}
|
||||
{#if data.user && data.user.uuid == adventure.user_id}
|
||||
<div class="fixed bottom-4 right-4 z-[999]">
|
||||
<button class="btn m-1 size-16 btn-primary" on:click={() => (isEditModalOpen = true)}
|
||||
><ClipboardList class="w-8 h-8" /></button
|
||||
|
||||
Reference in New Issue
Block a user