test for deployment
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# env files (can opt-in for committing if needed)
|
||||||
|
.env*
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
@@ -67,7 +67,7 @@ export async function POST(req: NextRequest) {
|
|||||||
if (!user)
|
if (!user)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{
|
{
|
||||||
message: 'Invalid email',
|
message: 'Email does not exist',
|
||||||
},
|
},
|
||||||
{ status: 401 }
|
{ status: 401 }
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export default function Calendar({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
axios
|
axios
|
||||||
.delete(
|
.delete(
|
||||||
`https://klayrion.netlify.app/api/posts`,
|
`/api/posts`,
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
id: sessionId,
|
id: sessionId,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function CalendarApp() {
|
|||||||
const [events, setEvents] = useState<CalendarSchedule[]>([]);
|
const [events, setEvents] = useState<CalendarSchedule[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
axios.get(`https://klayrion.netlify.app/api/posts/?id=${sessionId}`).then((response) => {
|
axios.get(`/api/posts/?id=${sessionId}`).then((response) => {
|
||||||
const v = response.data.schedules.map((e: any) => ({
|
const v = response.data.schedules.map((e: any) => ({
|
||||||
date: parse(e.scheduled, 'yyyy-MM-dd HH:mm', new Date()),
|
date: parse(e.scheduled, 'yyyy-MM-dd HH:mm', new Date()),
|
||||||
platforms: e.platforms,
|
platforms: e.platforms,
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export default function PostDialog({
|
|||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
axios.post('https://klayrion.netlify.app/api/posts', {
|
axios.post('/api/posts', {
|
||||||
sessionId,
|
sessionId,
|
||||||
platforms: ['andjksds'],
|
platforms: ['andjksds'],
|
||||||
content,
|
content,
|
||||||
@@ -139,7 +139,7 @@ export default function PostDialog({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const { data } = await axios.put('https://klayrion.netlify.app/api/posts', {
|
const { data } = await axios.put('/api/posts', {
|
||||||
scheduled: format(date, 'y-MM-dd hh:mm'),
|
scheduled: format(date, 'y-MM-dd hh:mm'),
|
||||||
sessionId,
|
sessionId,
|
||||||
platforms: ['andjksds'],
|
platforms: ['andjksds'],
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { redirect } from 'next/navigation';
|
|||||||
async function getSession(sessionId: string) {
|
async function getSession(sessionId: string) {
|
||||||
try {
|
try {
|
||||||
return (
|
return (
|
||||||
await axios.get(`/api/session/?id=${sessionId}`)
|
await axios.get(`http://localhost:3000/api/session/?id=${sessionId}`)
|
||||||
).data.dashboard;
|
).data.dashboard;
|
||||||
} catch {
|
} catch {
|
||||||
redirect('/login');
|
redirect('/login');
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ export default function Login() {
|
|||||||
|
|
||||||
const handleLogin = async () => {
|
const handleLogin = async () => {
|
||||||
try {
|
try {
|
||||||
|
console.log('logging in');
|
||||||
|
console.log(email);
|
||||||
const { sessionId } = (
|
const { sessionId } = (
|
||||||
await axios.post('https://klayrion.netlify.app/api/session/', {
|
await axios.post('/api/session/', {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default function SignUp() {
|
|||||||
console.log('Password:', password);
|
console.log('Password:', password);
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post('https://klayrion.netlify.app/api/account/', {
|
.post('/api/account/', {
|
||||||
name,
|
name,
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
|||||||
Reference in New Issue
Block a user