mirror of
https://github.com/get-drexa/drive.git
synced 2025-11-30 21:41:39 +00:00
style[convex]: reorganize imports
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
import { v } from "convex/values"
|
|
||||||
import type { Id } from "@fileone/convex/dataModel"
|
import type { Id } from "@fileone/convex/dataModel"
|
||||||
import { authenticatedMutation, authenticatedQuery, authorizedGet } from "./functions"
|
import { v } from "convex/values"
|
||||||
|
import {
|
||||||
|
authenticatedMutation,
|
||||||
|
authenticatedQuery,
|
||||||
|
authorizedGet,
|
||||||
|
} from "./functions"
|
||||||
import * as Directories from "./model/directories"
|
import * as Directories from "./model/directories"
|
||||||
import * as Files from "./model/files"
|
import * as Files from "./model/files"
|
||||||
import type { FileSystemItem } from "./shared/filesystem"
|
|
||||||
|
|
||||||
export const generateUploadUrl = authenticatedMutation({
|
export const generateUploadUrl = authenticatedMutation({
|
||||||
handler: async (ctx) => {
|
handler: async (ctx) => {
|
||||||
@@ -54,7 +57,7 @@ export const createDirectory = authenticatedMutation({
|
|||||||
if (!parentDirectory) {
|
if (!parentDirectory) {
|
||||||
throw new Error("Parent directory not found")
|
throw new Error("Parent directory not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
return await Directories.create(ctx, {
|
return await Directories.create(ctx, {
|
||||||
name,
|
name,
|
||||||
parentId: directoryId,
|
parentId: directoryId,
|
||||||
@@ -75,7 +78,7 @@ export const saveFile = authenticatedMutation({
|
|||||||
if (!directory) {
|
if (!directory) {
|
||||||
throw new Error("Directory not found")
|
throw new Error("Directory not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
|
|
||||||
await ctx.db.insert("files", {
|
await ctx.db.insert("files", {
|
||||||
@@ -102,7 +105,7 @@ export const renameFile = authenticatedMutation({
|
|||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error("File not found")
|
throw new Error("File not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
await Files.renameFile(ctx, { directoryId, itemId, newName })
|
await Files.renameFile(ctx, { directoryId, itemId, newName })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { v } from "convex/values"
|
import { v } from "convex/values"
|
||||||
import type { Doc, Id } from "@fileone/convex/dataModel"
|
import type { Doc, Id } from "../_generated/dataModel"
|
||||||
import {
|
import {
|
||||||
type AuthenticatedMutationCtx,
|
type AuthenticatedMutationCtx,
|
||||||
type AuthenticatedQueryCtx,
|
type AuthenticatedQueryCtx,
|
||||||
|
|||||||
Reference in New Issue
Block a user