feat(users): add drag-and-drop reordering for PICs
Introduce pic_sort_order to persist custom user ordering Replace data table with a custom draggable grid layout Add API endpoint to handle bulk order updates
This commit is contained in:
@@ -41,6 +41,29 @@ async function initializeDatabase() {
|
||||
add column if not exists phone_number text
|
||||
`
|
||||
|
||||
await sql`
|
||||
alter table users
|
||||
add column if not exists pic_sort_order integer not null default 0
|
||||
`
|
||||
|
||||
await sql`
|
||||
update users
|
||||
set pic_sort_order = seed.sort_order
|
||||
from (
|
||||
select
|
||||
id,
|
||||
row_number() over (
|
||||
order by
|
||||
case when role = 'super_admin' then 0 else 1 end,
|
||||
created_at asc,
|
||||
full_name asc
|
||||
) as sort_order
|
||||
from users
|
||||
) as seed
|
||||
where users.id = seed.id
|
||||
and users.pic_sort_order = 0
|
||||
`
|
||||
|
||||
await sql`
|
||||
create table if not exists user_passkeys (
|
||||
id text primary key,
|
||||
|
||||
Reference in New Issue
Block a user