-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Feature/subscription 75 ] 구독 & 구독 취소 API 연결 #78
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
554bc66
refactor: divide subscription and workbook
soomin9106 f50ec61
refactor: migrate subscribe bottom bar main to subscription
soomin9106 54ec84d
feat: redirect /workbook to /workbook/1
soomin9106 4293852
chore: add github domain in next js image
soomin9106 b6f9609
feat: subscribe API 연결
soomin9106 a2c81b9
feat: unsubscribe API
soomin9106 68edba2
chore: change file name
soomin9106 dd5e9b1
refactor: interface to type using Omit
soomin9106 6aac329
refactor: return if conditional statement is not met
soomin9106 c74e82c
refactor: use destructuring assignment
soomin9106 9553999
refactor: add onSubmit mode and remove safeParse
soomin9106 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,12 @@ export default function middleware(req: NextRequest) { | |
const nextUrl = req.nextUrl.clone(); | ||
const email = nextUrl.searchParams.get("user"); | ||
|
||
/** /workbook 으로 진입 시 리다이랙션 */ | ||
if (nextUrl.pathname === "/workbook") { | ||
nextUrl.pathname = "/workbook/1"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 나중에는 다른 workbook 페이지가 될수도 있을것같습니다...! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 맞아요!! 이 부분은 한 번 말해봐야겠네용!! |
||
return NextResponse.redirect(nextUrl); | ||
} | ||
|
||
if (email) { | ||
nextUrl.searchParams.delete("user"); | ||
const decodedEmail = decodeURIComponent(email); | ||
|
@@ -39,5 +45,5 @@ export default function middleware(req: NextRequest) { | |
} | ||
|
||
export const config = { | ||
matcher: ["/unsubscribe/:path*"], | ||
matcher: ["/unsubscribe/:path*", "/workbook/:path*"], | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에서 구조분해 할당하면 pathname으로도 가져올수있겟네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c74e82c
사용해봤습니다..!