sync, too many changes to list out

This commit is contained in:
41666 2019-03-18 04:52:54 -05:00
parent 3ba5bdb999
commit 6413d7c642
14 changed files with 469 additions and 32 deletions

13
ui/lib/redirect.js Normal file
View file

@ -0,0 +1,13 @@
import Router from 'next/router'
export default (context, target) => {
if (context.res) {
// server
// 303: "See other"
context.res.writeHead(303, { Location: target })
context.res.end()
} else {
// In the browser, we just pretend like this never even happened ;)
Router.replace(target)
}
}