Reorder categories (#12)

* feat: add next category id column

* feat: reorder categories (front)

* refactor: remove dead code & some optimization

* feat(wip): add order column + sql request + trigger

* refactor: fix warnings

* fix: syntax error in migration

* feat: create sql query (category reorder)

* feat: use prisma generated types instead

* feat: create some react context with hooks

* refactor: move a lot of code from home page to
dedicated components

* refactor: extend generated prisma types

* refactor: use hooks and move links footer in dedicated component

* refactor: fix bad types used

* fix: warnings caused by setState loop

* feat: use nextid instead of order column

* fix: reorder categories (front)

* fix: sort categories by nextId

* feat: prevent send update request if cat.id equal target.id

* fix: reorganization applied even if there is no change

* chore: remove unused en var

* feat: check if nextid category exist

* chore: sql query for migration

* refactor: remove useless code and prevent sending request when category not moving

* fix: redorder categories when sending request
This commit is contained in:
Sonny
2023-12-14 00:15:58 +01:00
committed by GitHub
parent 406bf281b0
commit ad682faa9e
57 changed files with 1016 additions and 572 deletions

View File

@@ -1,6 +1,6 @@
MYSQL_USER="my-user"
MYSQL_PASSWORD="my-user_passwd"
MYSQL_ROOT_PASSWORD="root_passwd"
MYSQL_USER="root"
MYSQL_PASSWORD="root"
MYSQL_ROOT_PASSWORD="root"
MYSQL_DATABASE="mylinks"
# Or if you need external Database
@@ -9,7 +9,6 @@ MYSQL_DATABASE="mylinks"
# DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${DATABASE_IP}:${DATABASE_PORT}/${MYSQL_DATABASE}"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_URL_INTERNAL="http://localhost:3000"
NEXT_PUBLIC_SITE_URL="http://localhost:3000"
NEXTAUTH_SECRET=""