Dramatically improve load times when creating a new team(#614)

* fix: attempts to reduce time taken to create team

* fix: fixes long time taken in team creation

* fix: refactors prisma logic

* feat: added logic for adding demo data while signing up

* fix: adds comment

* fix: adds another logic for adding demo data

* fix: adds service for adding demo data

* fix: fixes

* fix: adds demo product creation logic in next auth options

* fix: fixes next auth options

* fix: fixes team creation logic

* refactor: clean up

* fix: moves the logic for adding demo product while creating team in bg

* fix: moves individual queries in a transaction

* refactor: service

* fix: moves api route to app-dir

* fix: fixes api calls

* fix: fixes cache

* fix: removes unused code
This commit is contained in:
Anshuman Pandey
2023-08-05 17:29:06 +05:30
committed by GitHub
parent c707896eb6
commit ad42f4cc55
12 changed files with 1418 additions and 1290 deletions
+2
View File
@@ -27,7 +27,9 @@ export const SignupForm = () => {
if (!isValid) {
return;
}
setSigningUp(true);
try {
await createUser(
e.target.elements.name.value,
@@ -25,6 +25,7 @@ export default function CreateTeamModal({ open, setOpen }: CreateTeamModalProps)
const submitTeam = async (data) => {
setLoading(true);
const newTeam = await createTeam(data.name, (profile as any).id);
const newMemberships = await mutateMemberships();
changeEnvironmentByTeam(newTeam.id, newMemberships, router);
toast.success("Team created successfully!");