cleanup and cache the paste response 5 mins
This commit is contained in:
@ -16,6 +16,7 @@ export default function Home(): ReactElement {
|
||||
return;
|
||||
}
|
||||
|
||||
// Upload the paste to the server
|
||||
const response = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_API_ENDPOINT}/upload`,
|
||||
{
|
||||
@ -27,6 +28,7 @@ export default function Home(): ReactElement {
|
||||
},
|
||||
);
|
||||
|
||||
// Redirect to the new paste
|
||||
const data = await response.json();
|
||||
window.location.href = `/${data.id}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user