Replace unsafe id generator with nanoid (#4)

This commit is contained in:
Ivan Alexandrov
2023-12-13 18:28:35 +01:00
committed by GitHub
parent 705eca8c1c
commit c96c4f94b9
4 changed files with 29 additions and 7 deletions

View File

@@ -1,9 +1,10 @@
import { getPrisma } from '@/lib/prisma'
import { ExpenseFormValues, GroupFormValues } from '@/lib/schemas'
import { Expense } from '@prisma/client'
import { nanoid } from 'nanoid'
export function randomId() {
return Math.random().toString(36).slice(2, 9)
return nanoid()
}
export async function createGroup(groupFormValues: GroupFormValues) {