Skip to content

Commit

Permalink
Merge pull request #197 from isd-sgcu/main
Browse files Browse the repository at this point in the history
update main to dev
  • Loading branch information
TeeGoood authored Jul 30, 2024
2 parents f946fdb + 9634347 commit fdccd72
Show file tree
Hide file tree
Showing 13 changed files with 576 additions and 56 deletions.
17 changes: 17 additions & 0 deletions public/rpkm/freshy-night/confirm-register/modal-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ function Login() {
let newPath;

if (isStaff) {
newPath = isRegistered ? '/firstdate/staff/home' : '/staff/register';
const isRpkm =
new Date(process.env.NEXT_PUBLIC_RPKM_DAY_1 as string) < new Date();

newPath = !isRegistered
? '/staff/register'
: isRpkm
? '/rpkm/staff/home'
: '/firstdate/staff/home';
} else {
newPath = isRegistered ? '/home' : '/register';
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/(main)/staff/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ export default function Register() {
if (!user) return;
toast.success('ลงทะเบียนสำเร็จ');

const isStaff = user.role == 'staff';
const newPath = isStaff ? '/firstdate/staff/home' : '/register-done';
const isRpkm =
new Date(process.env.NEXT_PUBLIC_RPKM_DAY_1 as string) < new Date();

const newPath = isRpkm ? '/rpkm/staff/home' : '/firstdate/staff/home';

await resetContext();
router.push(newPath);
Expand Down
Loading

0 comments on commit fdccd72

Please sign in to comment.