File size: 865 Bytes
b80fc11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {
	apiCreateMount,
	apiFindOneMount,
	apiRemoveMount,
	apiUpdateMount,
} from "@/server/db/schema";
import {
	createMount,
	deleteMount,
	findMountById,
	updateMount,
} from "@dokploy/server";
import { createTRPCRouter, protectedProcedure } from "../trpc";

export const mountRouter = createTRPCRouter({
	create: protectedProcedure
		.input(apiCreateMount)
		.mutation(async ({ input }) => {
			await createMount(input);
			return true;
		}),
	remove: protectedProcedure
		.input(apiRemoveMount)
		.mutation(async ({ input }) => {
			return await deleteMount(input.mountId);
		}),

	one: protectedProcedure.input(apiFindOneMount).query(async ({ input }) => {
		return await findMountById(input.mountId);
	}),
	update: protectedProcedure
		.input(apiUpdateMount)
		.mutation(async ({ input }) => {
			return await updateMount(input.mountId, input);
		}),
});