cleanup inquiries
This commit is contained in:
parent
1dcbca0445
commit
81f0113ce2
@ -9,7 +9,6 @@ import type { Item } from '$lib/types/item';
|
||||
|
||||
export const load: PageServerLoad = async ({ url, locals, params }) => {
|
||||
const token: string | undefined = url.searchParams.get('token');
|
||||
// const itemId: string = params.itemId;
|
||||
const inquiryId: string = params.inquiryId;
|
||||
|
||||
if (token) {
|
||||
@ -56,7 +55,6 @@ export const load: PageServerLoad = async ({ url, locals, params }) => {
|
||||
export const actions: Actions = {
|
||||
reply: async ({ request, url, locals, params }) => {
|
||||
const token: string | undefined = url.searchParams.get('token');
|
||||
const itemId: number = params.itemId;
|
||||
const inquiryId: number = params.inquiryId;
|
||||
|
||||
let sender: Sender | undefined;
|
||||
@ -93,7 +91,6 @@ export const actions: Actions = {
|
||||
RETURNING id;
|
||||
`;
|
||||
|
||||
// TODO: Double check logic
|
||||
let nextReplySender: Sender;
|
||||
if (sender === Sender.ADMIN || sender === Sender.FINDER) {
|
||||
nextReplySender = Sender.INQUIRER;
|
||||
|
||||
@ -65,12 +65,10 @@
|
||||
<Separator class="my-6" />
|
||||
|
||||
<div class="relative">
|
||||
<!-- Conversation -->
|
||||
<div class="flex flex-col gap-6 relative">
|
||||
{#if data.item.threads}
|
||||
{#each data.item.threads[0].messages as msg (msg.id)}
|
||||
<div class="flex items-start gap-4">
|
||||
<!-- Avatar -->
|
||||
<div class="flex flex-col items-center">
|
||||
<div
|
||||
class={`flex items-center justify-center w-10 h-10 rounded-full text-white ${senderColor(msg.sender)}`}>
|
||||
@ -78,7 +76,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Message body -->
|
||||
<div class="bg-card rounded-lg p-3 shadow-sm max-w-xl">
|
||||
<p class="text-sm">{msg.body}</p>
|
||||
<span class="text-xs text-muted-foreground mt-1 block">{msg.createdAt.toLocaleString()}</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user