Added todos
This commit is contained in:
parent
b12ae87caf
commit
88f89ad12d
@ -119,3 +119,5 @@ model Order {
|
|||||||
user User @relation("UserOrders", fields: [userId], references: [id])
|
user User @relation("UserOrders", fields: [userId], references: [id])
|
||||||
artefacts Artefact[] @relation("OrderArtefacts")
|
artefacts Artefact[] @relation("OrderArtefacts")
|
||||||
}
|
}
|
||||||
|
// todo make user optional for if details aren't saved
|
||||||
|
// todo add email field to link order to user if created later on
|
||||||
|
|||||||
@ -16,8 +16,10 @@ type User = {
|
|||||||
createdAt: string;
|
createdAt: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// todo add fulfilling of requests
|
||||||
// todo create api route to get users, with auth for only admin
|
// todo create api route to get users, with auth for only admin
|
||||||
// todo add management of only junior scientists if senior scientist
|
// todo add management of only junior scientists if senior scientist
|
||||||
|
// todo (optional) add display of each user's previous orders when selecting them
|
||||||
const initialUsers: User[] = [
|
const initialUsers: User[] = [
|
||||||
{ email: "john@example.com", name: "John Doe", role: "ADMIN", password: "secret1", createdAt: "2024-06-21T09:15:01Z", id: 1 },
|
{ email: "john@example.com", name: "John Doe", role: "ADMIN", password: "secret1", createdAt: "2024-06-21T09:15:01Z", id: 1 },
|
||||||
{ email: "jane@example.com", name: "Jane Smith", role: "GUEST", password: "secret2", createdAt: "2024-06-21T10:01:09Z", id: 2 },
|
{ email: "jane@example.com", name: "Jane Smith", role: "GUEST", password: "secret2", createdAt: "2024-06-21T10:01:09Z", id: 2 },
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import { prisma } from "@utils/prisma";
|
|||||||
|
|
||||||
import { findUserByEmail, passwordStrengthCheck, readUserCsv, User, writeUserCsv } from "../functions/csvReadWrite";
|
import { findUserByEmail, passwordStrengthCheck, readUserCsv, User, writeUserCsv } from "../functions/csvReadWrite";
|
||||||
|
|
||||||
|
// todo check if orders contain email and link if order previously made with email
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
try {
|
try {
|
||||||
const { email, password, name } = await req.json(); // Parse incoming JSON data
|
const { email, password, name } = await req.json(); // Parse incoming JSON data
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import axios, { AxiosError } from 'axios';
|
import axios, { AxiosError } from "axios";
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from "next/navigation";
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from "react";
|
||||||
import { FaSignOutAlt } from 'react-icons/fa';
|
import { FaSignOutAlt } from "react-icons/fa";
|
||||||
import { FaUser } from 'react-icons/fa6';
|
import { FaUser } from "react-icons/fa6";
|
||||||
|
|
||||||
import { User } from '@appTypes/Prisma';
|
import { User } from "@appTypes/Prisma";
|
||||||
import { useStoreActions } from '@hooks/store';
|
import { useStoreActions } from "@hooks/store";
|
||||||
|
|
||||||
|
// todo add previous orders list
|
||||||
|
|
||||||
export default function Profile() {
|
export default function Profile() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
@ -181,7 +181,8 @@ export default function Shop() {
|
|||||||
}
|
}
|
||||||
// todo create receiving api route
|
// todo create receiving api route
|
||||||
// todo handle sending to api route
|
// todo handle sending to api route
|
||||||
// todo add option to save details in new account
|
// todo only ask for email if the user is not signed in
|
||||||
|
// todo (optional) add create account button to auto-fill email in sign-up modal
|
||||||
const genOrder = () => "#" + Math.random().toString(36).substring(2, 10).toUpperCase();
|
const genOrder = () => "#" + Math.random().toString(36).substring(2, 10).toUpperCase();
|
||||||
setOrderNumber(genOrder());
|
setOrderNumber(genOrder());
|
||||||
onClose();
|
onClose();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user