-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from DNDACADEMY/develop
fix: vercel blob cache issue로 최신 데이터 업데이트가 안되는 이슈 수정
- Loading branch information
Showing
27 changed files
with
358 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+5.66 KB
...-env-npm-14.2.4-9859535528-1f48bd96dd.zip → ...env-npm-14.2.12-27c97e7d02-9e1f36da7d.zip
Binary file not shown.
Binary file renamed
BIN
+30.9 KB
...next-npm-14.2.4-ca7149f339-44c94d13ae.zip → ...ext-npm-14.2.12-30a9126757-69930a9f1b.zip
Binary file not shown.
Binary file renamed
BIN
+35.7 MB
...c-darwin-x64-npm-14.2.4-56f1600da7-10.zip → ...-darwin-x64-npm-14.2.12-6155dead42-10.zip
Binary file not shown.
Binary file renamed
BIN
+10.2 KB
...ties-npm-14.2.4-533ad7cd14-7da1f7724b.zip → ...ies-npm-14.2.12-8fb06f2b75-de708999dc.zip
Binary file not shown.
Binary file renamed
BIN
+23.2 MB
...next-npm-14.2.4-37fb4e5b51-5bf2ccb4c6.zip → ...ext-npm-14.2.12-db57ef3403-4dcae15547.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
import { api, ApiError, getLatestItemReduce } from '@dnd-academy/core'; | ||
import { list } from '@vercel/blob'; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export async function GET(_: NextRequest, { params }: { params: { name: string } }) { | ||
if (!params?.name) { | ||
return NextResponse.json(null, { | ||
status: 400, | ||
statusText: 'Missing name parameter', | ||
}); | ||
} | ||
|
||
const { blobs } = await list({ | ||
prefix: params.name, | ||
token: process.env.BLOB_READ_WRITE_TOKEN, | ||
}); | ||
|
||
const blob = getLatestItemReduce(blobs); | ||
|
||
try { | ||
const responseBlobData = await api({ | ||
url: blob.url, | ||
method: 'GET', | ||
}); | ||
|
||
return Response.json(responseBlobData); | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
return NextResponse.json({ | ||
error: error.message, | ||
}, { | ||
status: error.status, | ||
statusText: error.message, | ||
}); | ||
} | ||
|
||
return NextResponse.json({ | ||
error: 'Internal Server Error', | ||
}, { | ||
status: 500, | ||
statusText: 'Internal Server Error', | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
import { api, ApiError, getLatestItemReduce } from '@dnd-academy/core'; | ||
import { list } from '@vercel/blob'; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export async function GET(_: NextRequest, { params }: { params: { name: string } }) { | ||
if (!params?.name) { | ||
return NextResponse.json(null, { | ||
status: 400, | ||
statusText: 'Missing name parameter', | ||
}); | ||
} | ||
|
||
const { blobs } = await list({ | ||
prefix: params.name, | ||
token: process.env.DND_ACADEMY_V2_BLOB_READ_WRITE_TOKEN, | ||
}); | ||
|
||
const blob = getLatestItemReduce(blobs); | ||
|
||
try { | ||
const responseBlobData = await api({ | ||
url: blob.url, | ||
method: 'GET', | ||
}); | ||
|
||
return Response.json(responseBlobData); | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
return NextResponse.json({ | ||
error: error.message, | ||
}, { | ||
status: error.status, | ||
statusText: error.message, | ||
}); | ||
} | ||
|
||
return NextResponse.json({ | ||
error: 'Internal Server Error', | ||
}, { | ||
status: 500, | ||
statusText: 'Internal Server Error', | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.