Skip to content

Commit 878df39

Browse files
committed
feat: delete borrow button
1 parent b4d18e1 commit 878df39

File tree

21 files changed

+203
-75
lines changed

21 files changed

+203
-75
lines changed

app/(protected)/admin/borrows/[id]/@edit/(.)edit/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default async function BorrowDetailsPage({
1010
}) {
1111
const { id } = await params
1212

13-
await Verify({ from: `/admin/borrows/${id}` })
13+
const headers = await Verify({ from: `/admin/borrows/${id}` })
1414

15-
const [borrowRes] = await Promise.all([getBorrow({ id })])
15+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
1616
if ('error' in borrowRes) {
1717
return <div>{JSON.stringify(borrowRes.message)}</div>
1818
}

app/(protected)/admin/borrows/[id]/@lost/(.)lost/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default async function BorrowDetailsPage({
1010
}) {
1111
const { id } = await params
1212

13-
await Verify({ from: `/admin/borrows/${id}` })
13+
const headers = await Verify({ from: `/admin/borrows/${id}` })
1414

15-
const [borrowRes] = await Promise.all([getBorrow({ id })])
15+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
1616
if ('error' in borrowRes) {
1717
return <div>{JSON.stringify(borrowRes.message)}</div>
1818
}

app/(protected)/admin/borrows/[id]/@return/(.)return/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default async function BorrowDetailsPage({
1010
}) {
1111
const { id } = await params
1212

13-
await Verify({ from: `/admin/borrows/${id}` })
13+
const headers = await Verify({ from: `/admin/borrows/${id}` })
1414

15-
const [borrowRes] = await Promise.all([getBorrow({ id })])
15+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
1616
if ('error' in borrowRes) {
1717
return <div>{JSON.stringify(borrowRes.message)}</div>
1818
}

app/(protected)/admin/borrows/[id]/edit/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export default async function BorrowDetailsPage({
99
}) {
1010
const { id } = await params
1111

12-
await Verify({ from: `/admin/borrows/${id}` })
12+
const headers = await Verify({ from: `/admin/borrows/${id}` })
1313

14-
const [borrowRes] = await Promise.all([getBorrow({ id })])
14+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
1515

1616
if ('error' in borrowRes) {
1717
console.log({ libRes: borrowRes })

app/(protected)/admin/borrows/[id]/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export default async function BorrowDetailsLayout({
2525
}>) {
2626
const { id } = await params
2727

28-
await Verify({ from: `/admin/borrows/${id}` })
28+
const headers = await Verify({ from: `/admin/borrows/${id}` })
2929

30-
const [borrowRes] = await Promise.all([getBorrow({ id })])
30+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
3131

3232
if ('error' in borrowRes) {
3333
console.log({ libRes: borrowRes })

app/(protected)/admin/borrows/[id]/lost/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export default async function BorrowLostPage({
99
}) {
1010
const { id } = await params
1111

12-
await Verify({ from: `/admin/borrows/${id}/lost` })
12+
const headers = await Verify({ from: `/admin/borrows/${id}/lost` })
1313

14-
const [borrowRes] = await Promise.all([getBorrow({ id })])
14+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
1515

1616
if ('error' in borrowRes) {
1717
console.log({ libRes: borrowRes })

app/(protected)/admin/borrows/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default async function BorrowDetailsPage({
2121

2222
const headers = await Verify({ from })
2323

24-
const [borrowRes] = await Promise.all([getBorrow({ id })])
24+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
2525

2626
if ('error' in borrowRes) {
2727
return <div>{JSON.stringify(borrowRes.message)}</div>

app/(protected)/admin/borrows/[id]/return/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export default async function BorrowReturnPage({
99
}) {
1010
const { id } = await params
1111

12-
await Verify({ from: `/admin/borrows/${id}/return` })
12+
const headers = await Verify({ from: `/admin/borrows/${id}/return` })
1313

14-
const [borrowRes] = await Promise.all([getBorrow({ id })])
14+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
1515

1616
if ('error' in borrowRes) {
1717
console.log({ libRes: borrowRes })

app/(protected)/admin/borrows/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,8 @@ export default async function Borrows({
133133
</div>
134134
<div className="hidden md:flex gap-2">
135135
<BtnScanReturnBorrow>
136-
<>
137-
<Scan className="mr-2 size-4" />
138-
Scan to Return
139-
</>
136+
<Scan className="mr-2 size-4" />
137+
Scan to Return
140138
</BtnScanReturnBorrow>
141139
<Button asChild>
142140
<Link href="/admin/borrows/new">

app/(protected)/borrows/[id]/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export default async function BorrowDetailsLayout({
1919
}>) {
2020
const { id } = await params
2121

22-
await Verify({ from: `/borrows/${id}` })
22+
const headers = await Verify({ from: `/borrows/${id}` })
2323

24-
const [borrowRes] = await Promise.all([getBorrow({ id })])
24+
const [borrowRes] = await Promise.all([getBorrow({ id }, { headers })])
2525

2626
if ('error' in borrowRes) {
2727
console.log({ libRes: borrowRes })

0 commit comments

Comments
 (0)