Skip to content

Commit

Permalink
Update route.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 21, 2024
1 parent 25912da commit f775940
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions next-enterprise/src/app/api/expire-tags/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expireTag} from 'next/cache'
import {revalidateTag} from 'next/cache'

export async function GET(request: Request) {
const url = new URL(request.url)
Expand All @@ -9,6 +9,8 @@ export async function GET(request: Request) {

const tags = url.searchParams.getAll('tag')
console.log('Expiring tags from expirator service', tags)
expireTag(...tags)
for (const tag of tags) {
revalidateTag(tag)
}
return Response.json({tags})
}

0 comments on commit f775940

Please sign in to comment.