feat: implement box management module with API services, UI components, and dependency updates
This commit is contained in:
@@ -20,7 +20,7 @@ import { createAuditLog, createNotification } from './repository';
|
||||
|
||||
export const getAllHouse = createServerFn({ method: 'GET' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(houseListSchema)
|
||||
.validator(houseListSchema)
|
||||
.handler(async ({ data }) => {
|
||||
try {
|
||||
const { page, limit, keyword } = data;
|
||||
@@ -118,7 +118,7 @@ export const getCurrentUserHouses = createServerFn({ method: 'GET' })
|
||||
|
||||
export const getHouseForSelect = createServerFn({ method: 'GET' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(houseForSelectSchema)
|
||||
.validator(houseForSelectSchema)
|
||||
.handler(async ({ data }) => {
|
||||
try {
|
||||
const result = await prisma.house.findMany({
|
||||
@@ -151,7 +151,7 @@ export const getHouseForSelect = createServerFn({ method: 'GET' })
|
||||
|
||||
export const createHouse = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(houseCreateBESchema)
|
||||
.validator(houseCreateBESchema)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const result = await auth.api.createOrganization({
|
||||
@@ -179,7 +179,7 @@ export const createHouse = createServerFn({ method: 'POST' })
|
||||
|
||||
export const updateHouse = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(houseEditBESchema)
|
||||
.validator(houseEditBESchema)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const currentHouse = await prisma.house.findUnique({
|
||||
@@ -216,7 +216,7 @@ export const updateHouse = createServerFn({ method: 'POST' })
|
||||
|
||||
export const deleteHouse = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(baseHouse)
|
||||
.validator(baseHouse)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const currentHouse = await prisma.house.findUnique({
|
||||
@@ -255,7 +255,7 @@ export const deleteHouse = createServerFn({ method: 'POST' })
|
||||
|
||||
export const deleteUserHouse = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(baseHouse)
|
||||
.validator(baseHouse)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const currentHouse = await prisma.house.findUnique({
|
||||
@@ -292,7 +292,7 @@ export const deleteUserHouse = createServerFn({ method: 'POST' })
|
||||
|
||||
export const invitationMember = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(invitationCreateBESchema)
|
||||
.validator(invitationCreateBESchema)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const headers = getRequestHeaders();
|
||||
@@ -347,7 +347,7 @@ export const invitationMember = createServerFn({ method: 'POST' })
|
||||
|
||||
export const cancelInvitation = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(baseHouse)
|
||||
.validator(baseHouse)
|
||||
.handler(async ({ data }) => {
|
||||
try {
|
||||
const headers = getRequestHeaders();
|
||||
@@ -381,7 +381,7 @@ export const cancelInvitation = createServerFn({ method: 'POST' })
|
||||
|
||||
export const acceptInvitation = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(actionInvitationSchema)
|
||||
.validator(actionInvitationSchema)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const result = await prisma.invitation.update({
|
||||
@@ -434,7 +434,7 @@ export const acceptInvitation = createServerFn({ method: 'POST' })
|
||||
|
||||
export const rejectInvitation = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(actionInvitationSchema)
|
||||
.validator(actionInvitationSchema)
|
||||
.handler(async ({ data }) => {
|
||||
try {
|
||||
const headers = getRequestHeaders();
|
||||
@@ -462,7 +462,7 @@ export const rejectInvitation = createServerFn({ method: 'POST' })
|
||||
|
||||
export const leaveHouse = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(baseHouse)
|
||||
.validator(baseHouse)
|
||||
.handler(async ({ data }) => {
|
||||
try {
|
||||
const headers = getRequestHeaders();
|
||||
@@ -494,7 +494,7 @@ export const leaveHouse = createServerFn({ method: 'POST' })
|
||||
|
||||
export const removeMember = createServerFn({ method: 'POST' })
|
||||
.middleware([authMiddleware])
|
||||
.inputValidator(removeMemberSchema)
|
||||
.validator(removeMemberSchema)
|
||||
.handler(async ({ data, context: { user } }) => {
|
||||
try {
|
||||
const headers = getRequestHeaders();
|
||||
|
||||
Reference in New Issue
Block a user