Skip to content

Commit 3c66ec4

Browse files
committed
fix search cleanup
1 parent cd3e090 commit 3c66ec4

File tree

34 files changed

+34
-0
lines changed
  • exercises
    • 01.init
      • 01.problem.static/server
      • 01.solution.static/server
    • 02.server-components
      • 01.problem.rsc/server
      • 01.solution.rsc/server
      • 02.problem.async-components/server
      • 02.solution.async-components/server
      • 03.problem.streaming/server
      • 03.solution.streaming/server
      • 04.problem.server-context/server
      • 04.solution.server-context/server
    • 03.client-components
      • 01.problem.loader/server
      • 01.solution.loader/server
      • 02.problem.module-resolution/server
      • 02.solution.module-resolution/server
    • 04.router
      • 01.problem.router/server
      • 01.solution.router/server
      • 02.problem.pending-ui/server
      • 02.solution.pending-ui/server
      • 03.problem.race-conditions/server
      • 03.solution.race-conditions/server
      • 04.problem.history/server
      • 04.solution.history/server
      • 05.problem.cache/server
      • 05.solution.cache/server
    • 05.actions
      • 01.problem.action-reference/server
      • 01.solution.action-reference/server
      • 02.problem.client/server
      • 02.solution.client/server
      • 03.problem.server/server
      • 03.solution.server/server
      • 04.problem.revalidation/server
      • 04.solution.revalidation/server
      • 05.problem.history-revalidation/server
      • 05.solution.history-revalidation/server

34 files changed

+34
-0
lines changed

exercises/01.init/01.problem.static/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ app.use(trimTrailingSlash())
3232
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3333
app.use(async (context, next) => {
3434
if (context.req.query('search') === '') {
35+
const url = new URL(context.req.url)
3536
const searchParams = new URLSearchParams(url.search)
3637
searchParams.delete('search')
3738
const location = [url.pathname, searchParams.toString()]

exercises/01.init/01.solution.static/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ app.use(
2626
// for RSCs... Just ... I just can't help myself. I like URLs clean.
2727
app.use(async (context, next) => {
2828
if (context.req.query('search') === '') {
29+
const url = new URL(context.req.url)
2930
const searchParams = new URLSearchParams(url.search)
3031
searchParams.delete('search')
3132
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/01.problem.rsc/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ app.use(
3333
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3434
app.use(async (context, next) => {
3535
if (context.req.query('search') === '') {
36+
const url = new URL(context.req.url)
3637
const searchParams = new URLSearchParams(url.search)
3738
searchParams.delete('search')
3839
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/01.solution.rsc/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ app.use(
3030
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3131
app.use(async (context, next) => {
3232
if (context.req.query('search') === '') {
33+
const url = new URL(context.req.url)
3334
const searchParams = new URLSearchParams(url.search)
3435
searchParams.delete('search')
3536
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/02.problem.async-components/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ app.use(
3030
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3131
app.use(async (context, next) => {
3232
if (context.req.query('search') === '') {
33+
const url = new URL(context.req.url)
3334
const searchParams = new URLSearchParams(url.search)
3435
searchParams.delete('search')
3536
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/02.solution.async-components/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ app.use(
2929
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3030
app.use(async (context, next) => {
3131
if (context.req.query('search') === '') {
32+
const url = new URL(context.req.url)
3233
const searchParams = new URLSearchParams(url.search)
3334
searchParams.delete('search')
3435
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/03.problem.streaming/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ app.use(
2929
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3030
app.use(async (context, next) => {
3131
if (context.req.query('search') === '') {
32+
const url = new URL(context.req.url)
3233
const searchParams = new URLSearchParams(url.search)
3334
searchParams.delete('search')
3435
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/03.solution.streaming/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ app.use(
2929
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3030
app.use(async (context, next) => {
3131
if (context.req.query('search') === '') {
32+
const url = new URL(context.req.url)
3233
const searchParams = new URLSearchParams(url.search)
3334
searchParams.delete('search')
3435
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/04.problem.server-context/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ app.use(
3131
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3232
app.use(async (context, next) => {
3333
if (context.req.query('search') === '') {
34+
const url = new URL(context.req.url)
3435
const searchParams = new URLSearchParams(url.search)
3536
searchParams.delete('search')
3637
const location = [url.pathname, searchParams.toString()]

exercises/02.server-components/04.solution.server-context/server/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ app.use(
3030
// for RSCs... Just ... I just can't help myself. I like URLs clean.
3131
app.use(async (context, next) => {
3232
if (context.req.query('search') === '') {
33+
const url = new URL(context.req.url)
3334
const searchParams = new URLSearchParams(url.search)
3435
searchParams.delete('search')
3536
const location = [url.pathname, searchParams.toString()]

0 commit comments

Comments
 (0)