From c43224297f983c654d080c3411c5f7311597737e Mon Sep 17 00:00:00 2001 From: prokawsar Date: Thu, 11 Jul 2024 20:40:01 +0600 Subject: [PATCH 01/23] History wip --- package.json | 2 ++ src/lib/elements/Input.svelte | 2 ++ src/lib/stores/index.ts | 14 +++++++++++ src/routes/+layout.svelte | 10 ++++++++ src/routes/+page.svelte | 12 +++++++-- src/routes/history/+page.svelte | 44 +++++++++++++++++++++++++++++++++ 6 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 src/lib/stores/index.ts create mode 100644 src/routes/history/+page.svelte diff --git a/package.json b/package.json index 8df64c2..9e1c6e5 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,9 @@ "type": "module", "dependencies": { "@fontsource/jost": "^5.0.18", + "dayjs": "^1.11.11", "mixpanel-browser": "^2.53.0", + "svelte-persisted-store": "^0.11.0", "tippy.js": "^6.3.7" } } diff --git a/src/lib/elements/Input.svelte b/src/lib/elements/Input.svelte index 1889c8e..74ba4ee 100644 --- a/src/lib/elements/Input.svelte +++ b/src/lib/elements/Input.svelte @@ -1,9 +1,11 @@ { + return persisted<{ history: PaperHistory[] }>('paper_cost_history', { history: [] }) +} + +export const paperHistoryStore = getPaperStore() diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6824dbf..57052eb 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,4 +1,5 @@ + +
+

History

+
+
+
+ {#if $paperHistoryStore.history.length} + {#each $paperHistoryStore.history as { finalPrice, papers, date }, i} +
+
+

+ {days(date).format('DD-MM-YYYY')} +

+

+ {finalPrice.toFixed(2)} +

+
+ +
+ {/each} + {/if} +
+
+
From 13518c1c5526f4fbae8985a7d633b53c5e3074bc Mon Sep 17 00:00:00 2001 From: prokawsar Date: Thu, 11 Jul 2024 21:05:14 +0600 Subject: [PATCH 02/23] History ID --- src/lib/stores/index.ts | 1 + src/routes/+page.svelte | 1 + src/routes/history/+page.svelte | 26 ++++-------- src/routes/history/[id]/+page.svelte | 59 ++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 src/routes/history/[id]/+page.svelte diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 3dedd15..2777f75 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -3,6 +3,7 @@ import { persisted } from 'svelte-persisted-store' import type { Writable } from 'svelte/store' export type PaperHistory = { + id: string finalPrice: number date?: Date papers: Paper[] diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 91d8e01..8bcf783 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -45,6 +45,7 @@ // Saving to history $paperHistoryStore.history.push({ + id: makeid(6), finalPrice, date: new Date(), papers: paperCount diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index 10e335a..f124628 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -1,5 +1,4 @@ + +
+

History Details

+

+ {dayjs(data[0].date).format('DD-MM-YYYY hh:mmA')} +

+
+ +
+
+ {#if data.length} + {#each data as history, i} +
+

height

+

width

+

thickness

+

rate

+
+ {#each history.papers as { height, width, thickness, rate }, i} +
+
+ + + + + +
+
+ {/each} + +
+ {#if history.finalPrice} + + {/if} +
+ {/each} + {:else} +

No history details

+ {/if} +
+
+
From 048a72b811115dea4f0f74d270adc2f8d84a0a53 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Thu, 11 Jul 2024 21:10:41 +0600 Subject: [PATCH 03/23] History --- src/routes/+page.svelte | 2 +- src/routes/history/+page.svelte | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8bcf783..a9087a9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -83,7 +83,7 @@ Paper Cost Calculator -
+

Paper Cost

diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index f124628..15530f0 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -5,7 +5,12 @@
-

History

+
+

History

+

+ {$paperHistoryStore.history.length} +

+
From a64f305333dfa936d1eeee1e6230c83344ee9e6b Mon Sep 17 00:00:00 2001 From: prokawsar Date: Thu, 11 Jul 2024 21:13:43 +0600 Subject: [PATCH 04/23] Reverse --- src/routes/history/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index 15530f0..b244c42 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -15,7 +15,7 @@
{#if $paperHistoryStore.history.length} - {#each $paperHistoryStore.history as { id, finalPrice, papers, date }, i} + {#each $paperHistoryStore.history.reverse() as { id, finalPrice, papers, date }, i}
From 45ffa99bcd4829d1476bb03d731b3514204d9c36 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Thu, 11 Jul 2024 21:15:33 +0600 Subject: [PATCH 05/23] Remove log --- src/routes/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index a9087a9..1abf278 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -14,7 +14,7 @@ thickness: '', rate: '' } - $: console.log($paperHistoryStore.history) + let paperCount: Paper[] = [{ ...paperFields, id: makeid(5) }] let perPaperResult: Map = new Map() let finalPrice: number = 0 From 03682d16ee43f1073a5968063ffea879549878a4 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Sun, 14 Jul 2024 20:58:40 +0600 Subject: [PATCH 06/23] History wip --- package.json | 1 + src/lib/db/supabaseClient.ts | 4 +++ src/lib/elements/Input.svelte | 3 ++- src/lib/stores/index.ts | 16 ++++-------- src/lib/utils/services.ts | 33 ++++++++++++++++++++++++ src/routes/+layout.svelte | 11 ++++---- src/routes/+page.svelte | 30 ++++++++++++---------- src/routes/history/+page.server.ts | 8 ++++++ src/routes/history/+page.svelte | 23 ++++++++++++----- src/routes/history/[id]/+page.svelte | 38 ++++++++++++++-------------- 10 files changed, 111 insertions(+), 56 deletions(-) create mode 100644 src/lib/db/supabaseClient.ts create mode 100644 src/routes/history/+page.server.ts diff --git a/package.json b/package.json index 9e1c6e5..d618d49 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "type": "module", "dependencies": { "@fontsource/jost": "^5.0.18", + "@supabase/supabase-js": "^2.44.3", "dayjs": "^1.11.11", "mixpanel-browser": "^2.53.0", "svelte-persisted-store": "^0.11.0", diff --git a/src/lib/db/supabaseClient.ts b/src/lib/db/supabaseClient.ts new file mode 100644 index 0000000..d0c0d9f --- /dev/null +++ b/src/lib/db/supabaseClient.ts @@ -0,0 +1,4 @@ +import { PUBLIC_SUPABASE_ANON, PUBLIC_SUPABASE_URL } from '$env/static/public' +import { createClient } from '@supabase/supabase-js' + +export const supabase = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON) diff --git a/src/lib/elements/Input.svelte b/src/lib/elements/Input.svelte index 05ec5b5..6cdd1d3 100644 --- a/src/lib/elements/Input.svelte +++ b/src/lib/elements/Input.svelte @@ -6,6 +6,7 @@ export let value: string export let placeholder: string = '' export let disabled: boolean = false + export let classNames: string = '' let inputRef: HTMLInputElement @@ -14,7 +15,7 @@ bind:this={inputRef} {id} {disabled} - class="input-field focus:!border-[1.5px] focus:!border-teal-500 focus:outline-none" + class="input-field focus:!border-[1.5px] focus:!border-teal-500 focus:outline-none {classNames}" type="number" {placeholder} bind:value diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 92c0287..19666f3 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -1,16 +1,10 @@ -import type { Paper } from '$lib/utils/services' import { persisted } from 'svelte-persisted-store' import { writable, type Writable } from 'svelte/store' +import type { CostHistoryType } from '$lib/utils/services' -export type PaperHistory = { - id: string - finalPrice: number - date?: Date - papers: Paper[] -} -function getPaperStore(): Writable<{ history: PaperHistory[] }> { - return persisted<{ history: PaperHistory[] }>('paper_cost_history', { history: [] }) -} +// function getPaperStore(): Writable { +// return persisted('paper_cost_history', []) +// } -export const paperHistoryStore = getPaperStore() +export const paperHistoryStore = writable([]) export const focusedInputStore: Writable = writable(null) diff --git a/src/lib/utils/services.ts b/src/lib/utils/services.ts index 6a1eaa2..b72428b 100644 --- a/src/lib/utils/services.ts +++ b/src/lib/utils/services.ts @@ -1,3 +1,5 @@ +import { supabase } from '$lib/db/supabaseClient' + export type Paper = { id: string length: string @@ -7,5 +9,36 @@ export type Paper = { [key: string]: string } +export type CostHistoryType = { + id?: string + name: string + papers: Paper[] + final_price: number + created_at?: string +} + export const PAPER_FIXED = 1550000 export const MAX_PAPER = 10 + +export const calculateCost = (paper: Paper): number => { + const paperSize = parseFloat(paper.length) * parseFloat(paper.width) * parseFloat(paper.thickness) + const result = paperSize / PAPER_FIXED + return result * parseFloat(paper.rate) +} + +export const addHistory = async (history: CostHistoryType) => { + const { data, error } = await supabase.from('history').insert({ + name: history.name || '', + papers: history.papers || [], + final_price: history.final_price || 100 + }) + if (!error) { + return data + } + return error +} + +export const deleteHistory = async (id: string) => { + const response = await supabase.from('history').delete().eq('id', id) + return response +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3bfb320..834dccd 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,4 +1,5 @@ + + History + +

History

- {$paperHistoryStore.history.length} + {data.histories.length}

- {#if $paperHistoryStore.history.length} - {#each $paperHistoryStore.history.reverse() as { id, finalPrice, papers, date }, i} + {#if data.histories.length} + {#each data.histories.reverse() as { name, id, final_price, papers, created_at }, i} diff --git a/src/routes/history/[id]/+page.svelte b/src/routes/history/[id]/+page.svelte index c10e635..200c43b 100644 --- a/src/routes/history/[id]/+page.svelte +++ b/src/routes/history/[id]/+page.svelte @@ -2,37 +2,37 @@ import { page } from '$app/stores' import Input from '$lib/elements/Input.svelte' import Result from '$lib/elements/Result.svelte' - import { paperHistoryStore, type PaperHistory } from '$lib/stores' + import { paperHistoryStore } from '$lib/stores' import dayjs from 'dayjs' + import type { CostHistoryType } from '$lib/utils/services' - const data: PaperHistory[] = $paperHistoryStore.history.filter( + const data: CostHistoryType[] = $paperHistoryStore.filter( (history) => history.id == $page.params.id ) + + History + +

History Details

-

- {dayjs(data[0].date).format('DD-MM-YYYY hh:mmA')} -

+
+

{data[0].name || ''}

+

+ {dayjs(data[0].created_at).format('DD-MM-YYYY hh:mmA')} +

+
-
+
{#if data.length} {#each data as history, i} -
-

height

-

width

-

thickness

-

rate

-
- {#each history.papers as { height, width, thickness, rate }, i} -
+ {#each history.papers as { length, width, thickness, rate }, i} +
- + @@ -46,8 +46,8 @@ {/each}
- {#if history.finalPrice} - + {#if history.final_price} + {/if}
{/each} From 8aed11bef7f34e878fef016fc319015fc2c296d0 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Sun, 14 Jul 2024 21:09:18 +0600 Subject: [PATCH 07/23] Delete history --- src/lib/elements/Input.svelte | 2 +- src/routes/history/+page.svelte | 16 +++++++++++++++- src/routes/history/[id]/+page.svelte | 20 +++++++++++--------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/lib/elements/Input.svelte b/src/lib/elements/Input.svelte index 6cdd1d3..d401cfb 100644 --- a/src/lib/elements/Input.svelte +++ b/src/lib/elements/Input.svelte @@ -26,6 +26,6 @@ diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index 1065579..1107e9c 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -1,10 +1,18 @@ @@ -24,7 +32,7 @@ {#if data.histories.length} {#each data.histories.reverse() as { name, id, final_price, papers, created_at }, i} {/each} diff --git a/src/routes/history/[id]/+page.svelte b/src/routes/history/[id]/+page.svelte index 200c43b..17acb58 100644 --- a/src/routes/history/[id]/+page.svelte +++ b/src/routes/history/[id]/+page.svelte @@ -4,7 +4,7 @@ import Result from '$lib/elements/Result.svelte' import { paperHistoryStore } from '$lib/stores' import dayjs from 'dayjs' - import type { CostHistoryType } from '$lib/utils/services' + import { calculateCost, type CostHistoryType } from '$lib/utils/services' const data: CostHistoryType[] = $paperHistoryStore.filter( (history) => history.id == $page.params.id @@ -29,18 +29,20 @@
{#if data.length} {#each data as history, i} - {#each history.papers as { length, width, thickness, rate }, i} -
-
+ {#each history.papers as { length, width, thickness, rate, id }, i} +
+
- +
+

+ = {calculateCost({ length, width, thickness, rate, id }).toFixed(2)} +

+
{/each} From d0c80fc51ba861ad6a0d4af1e7e8cc852e719c48 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Sun, 14 Jul 2024 21:19:26 +0600 Subject: [PATCH 08/23] wip --- src/lib/utils/services.ts | 8 ++++++++ src/routes/history/[id]/+page.server.ts | 8 ++++++++ src/routes/history/[id]/+page.svelte | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 src/routes/history/[id]/+page.server.ts diff --git a/src/lib/utils/services.ts b/src/lib/utils/services.ts index b72428b..bc1db20 100644 --- a/src/lib/utils/services.ts +++ b/src/lib/utils/services.ts @@ -38,6 +38,14 @@ export const addHistory = async (history: CostHistoryType) => { return error } +export const getHistory = async (id: string): Promise => { + const { data, error } = await supabase.from('history').select().eq('id', id) + if (!error) { + return data as unknown as CostHistoryType + } + return null +} + export const deleteHistory = async (id: string) => { const response = await supabase.from('history').delete().eq('id', id) return response diff --git a/src/routes/history/[id]/+page.server.ts b/src/routes/history/[id]/+page.server.ts new file mode 100644 index 0000000..86f6ed6 --- /dev/null +++ b/src/routes/history/[id]/+page.server.ts @@ -0,0 +1,8 @@ +import { getHistory } from '$lib/utils/services' + +export async function load({ params }) { + const data = await getHistory(params.id) + return { + history: data ?? [] + } +} diff --git a/src/routes/history/[id]/+page.svelte b/src/routes/history/[id]/+page.svelte index 17acb58..8be1ebc 100644 --- a/src/routes/history/[id]/+page.svelte +++ b/src/routes/history/[id]/+page.svelte @@ -9,6 +9,9 @@ const data: CostHistoryType[] = $paperHistoryStore.filter( (history) => history.id == $page.params.id ) + + // export let data + // let history: CostHistoryType = data.history[0] From 6d7174248f41b2c7c01f9089fbf7b974e7aa7ee9 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Mon, 15 Jul 2024 07:20:01 +0600 Subject: [PATCH 09/23] logo update --- static/logo.jpeg | Bin 7233 -> 7540 bytes static/logo.png | Bin 3041 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 static/logo.png diff --git a/static/logo.jpeg b/static/logo.jpeg index 76611a2ffb7ebf356aedeeeb2121746378eaa1f0..e3e6798f4c9862af750b5c2b28a95f5636113868 100644 GIT binary patch delta 6419 zcmbt&do+}9^zU?$icId5Oum#m%SiayPl(iD870 zTa){YYsD}_#>?E!{LVV(kF(D2w|-}>v(~$x_g&B0Yd`zlYk&6s?59)b@8!=Q4jy^| zS*a;JID7#35D$_2|CPe28^28wzaKC>ZBeL#`+e=0;Q^DYa)&e^mN$jaT9})Vn{ow0 z5KAMu9*B^oAxGjbUgHvan0WhuAt1zA{%_$*Fm-QhOcujGdh@J!=X~1$&7Tc<=8v>z zR;c<(fsrJ~>plFxTSWG~&@!(rYJ>c^rSastp)fCoAE&u2CS`x4Jh@9M~h zfts%dko;iDX_2Ys*({zM;yaj*BvEzg>Kd?x5o_EQ?b5w!qtn@?o}=uhIBj=s%&BO~ zf6g=(?@~(WcHF8h&uxIik)mwKk?*K6CwY-A$1o3z??en@w%AJqQ7a*NPyUgcZr<@F zA6*Z~{_YDlggB;}fKLCY=9#BKIf53eTyiw{6Mpj1(n;lmOMKUO^>>8VF_e2S5V$10 zz`Z^|HwJMeIL?{t*JYp8=bKzFhT1CkGE--?Gs^81{Vi|%y42--6*me=!ohOv*${>> zHx11!Z*}%5B^~iHKb17H=hqumBn=K0O_C1>wBI(K+3A{* z4(W-K^e)!20`O{&PziL(0}pc{H+!ul4P{KQd1?OI?cwI7Jx-;LcdQ|%RLC@C5M z3WmA&Z)DNdZN=8j zL`c=-Q!b~aw7rKGTii)e0Zy6XVA5NPyFjw6Mz?i&89X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+vcBBZBS`V(T-Fw>A~XHrj* z%l!~y4KqDbNG|tS`S|}n1gVY7F{D(xcT7`L;qfJiHO%oyp*0motBdjY6vP^47*c3m zjQEE*0BCihu%h^6J7A!;$!PUy?!v5L^5Q&DpN6_5QmdIE)-cf`SKU>pOGun+$Q9|3 za_TgXR4)&(SL=(mWun(jL|m&BL#m%n-6N#cHz5-uzG0Ff)i1i&uenEBFc`Hj5o`F< z-;nChU424Q(LFk0lp}Zjd588{$|YNBUlIU0gqSt#Ju6r$#aaj{jmRLxOPKoYKy2X< zlh>e)(8^z)p?$U;gpH73o-yhOgMa;y&*72v;zw&OX#X{lQw#cbfcpcMgMM-U7JF$C zDQ+OzAZ>aZ+mb5AJt^3GR|bJOeI-^S=)mDPQkKIQL8R zurnSY^TmbF&sR#GOMVjE{3#7qLqd$%K*>9(;w|a>5~uH-6WGib+L-TQwr# z7{ve`l$*VX$~)K}6B6NJ#%8>#eg)CH1TGXi0}I4VI#r3)m$ zb{s;ZZ>hej^vS~x6eKi#wGfzBmA-xszj|0f2+f>x(P2Alo^M(6ORYeJalHBo*N|rT z9U1FGTfqp8Hd_?{(mdlFsQK;+Noe$XiCB<{R$t83p{u}zX8HI$M_EpxRC!h$Udd%b zAq6MA>Fu~nwHKwzb-Mc=a_5pHLU_~L`}vgVeDDBLCArQ{=Xa{ Date: Mon, 15 Jul 2024 07:54:35 +0600 Subject: [PATCH 10/23] Loader --- src/lib/elements/Loader.svelte | 5 +++ src/routes/history/+page.svelte | 63 ++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 src/lib/elements/Loader.svelte diff --git a/src/lib/elements/Loader.svelte b/src/lib/elements/Loader.svelte new file mode 100644 index 0000000..449749f --- /dev/null +++ b/src/lib/elements/Loader.svelte @@ -0,0 +1,5 @@ + + + diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index 1107e9c..3b2dd25 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -1,17 +1,21 @@ @@ -28,33 +32,42 @@
-
- {#if data.histories.length} - {#each data.histories.reverse() as { name, id, final_price, papers, created_at }, i} - - {/each} +

+ {name} +

+

+ {days(created_at).format('DD-MM-YYYY hh:mmA')} +

+

+ {final_price.toFixed(2)} +

+ + +
+ {/each} + {:else} +

No history yet

+ {/if} {:else} -

No history yet

+
+ +
{/if}
From e965a3cfe98b1896fe62922ce416a2a7a9a138c4 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Mon, 15 Jul 2024 08:05:06 +0600 Subject: [PATCH 11/23] Delete confirm --- src/routes/history/+page.svelte | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index 3b2dd25..a769468 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -8,6 +8,7 @@ export let data let isLoading = false + let deleteConfirm = false $paperHistoryStore = data.histories @@ -52,12 +53,29 @@

{final_price.toFixed(2)}

- +
+ + {#if deleteConfirm} + + + {/if} +
{/each} From 69057d90f05ef153189d59ad87f5856c5da5c063 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Mon, 15 Jul 2024 08:14:31 +0600 Subject: [PATCH 12/23] ui --- src/routes/history/+page.svelte | 12 ++++++------ src/routes/history/[id]/+page.svelte | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index a769468..725987b 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -44,32 +44,32 @@ href="/history/{id}" class="flex flex-row items-center pl-1 justify-between w-full" > -

+

{name}

-

+

{days(created_at).format('DD-MM-YYYY hh:mmA')}

-

+

{final_price.toFixed(2)}

{#if deleteConfirm}
+
From a7997f4b8fb8cf4cb901fc1c411073a7d0b63025 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Mon, 15 Jul 2024 08:49:15 +0600 Subject: [PATCH 14/23] get single --- src/lib/utils/services.ts | 4 +- src/routes/(app)/history/[id]/+page.server.ts | 2 +- src/routes/(app)/history/[id]/+page.svelte | 41 ++++++++----------- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/lib/utils/services.ts b/src/lib/utils/services.ts index bc1db20..b27fb3f 100644 --- a/src/lib/utils/services.ts +++ b/src/lib/utils/services.ts @@ -38,10 +38,10 @@ export const addHistory = async (history: CostHistoryType) => { return error } -export const getHistory = async (id: string): Promise => { +export const getHistory = async (id: string): Promise => { const { data, error } = await supabase.from('history').select().eq('id', id) if (!error) { - return data as unknown as CostHistoryType + return data as unknown as CostHistoryType[] } return null } diff --git a/src/routes/(app)/history/[id]/+page.server.ts b/src/routes/(app)/history/[id]/+page.server.ts index 86f6ed6..8bf4f99 100644 --- a/src/routes/(app)/history/[id]/+page.server.ts +++ b/src/routes/(app)/history/[id]/+page.server.ts @@ -3,6 +3,6 @@ import { getHistory } from '$lib/utils/services' export async function load({ params }) { const data = await getHistory(params.id) return { - history: data ?? [] + history: data ? data[0] : null } } diff --git a/src/routes/(app)/history/[id]/+page.svelte b/src/routes/(app)/history/[id]/+page.svelte index 86e1c90..6496920 100644 --- a/src/routes/(app)/history/[id]/+page.svelte +++ b/src/routes/(app)/history/[id]/+page.svelte @@ -1,17 +1,12 @@ @@ -21,18 +16,18 @@

Cost Details

-
-

{data[0].name || ''}

-

- {dayjs(data[0].created_at).format('DD-MM-YYYY hh:mmA')} -

-
+ {#if history} +
+

{history.name || ''}

+

+ {dayjs(history.created_at).format('DD-MM-YYYY hh:mmA')} +

+
-
-
- {#if data.length} - {#each data as history, i} - {#each history.papers as { length, width, thickness, rate, id }, i} +
+
+ {#if history.papers.length} + {#each history.papers as { length, width, thickness, rate, id }}
{/if}
- {/each} - {:else} -

No history details

- {/if} + {/if} +
-
+ {:else} +

No cost history details

+ {/if}
From 8173eb9e03d45b033162ffbd840c6a44075379c9 Mon Sep 17 00:00:00 2001 From: prokawsar Date: Mon, 15 Jul 2024 09:08:31 +0600 Subject: [PATCH 15/23] login ui --- src/lib/elements/Button.svelte | 13 +++++++++++ src/lib/elements/Input.svelte | 3 +-- src/routes/auth/login/+page.svelte | 35 ++++++++++++++++++++++++++---- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/lib/elements/Button.svelte b/src/lib/elements/Button.svelte index 6c8230f..d8f9d56 100644 --- a/src/lib/elements/Button.svelte +++ b/src/lib/elements/Button.svelte @@ -1,11 +1,24 @@