chore: lint and fmt
This commit is contained in:
16
src/modules/note/cache/prepareNoteCache.ts
vendored
16
src/modules/note/cache/prepareNoteCache.ts
vendored
@@ -1,14 +1,14 @@
|
||||
import { data } from '@/data/data'
|
||||
import { DataType } from '@/data/DataType.enum'
|
||||
import { Note } from '@/modules/note/models/Note'
|
||||
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
|
||||
import { data } from "@/data/data"
|
||||
import { DataType } from "@/data/DataType.enum"
|
||||
import { Note } from "@/modules/note/models/Note"
|
||||
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
|
||||
|
||||
type NoteCacheResult =
|
||||
| {
|
||||
note: Note
|
||||
from: 'sha'
|
||||
from: "sha"
|
||||
}
|
||||
| { note: Note; from: 'path' }
|
||||
| { note: Note; from: "path" }
|
||||
| { note: null; from: null }
|
||||
|
||||
export const prepareNoteCache = (sha: string, path?: string) => {
|
||||
@@ -20,7 +20,7 @@ export const prepareNoteCache = (sha: string, path?: string) => {
|
||||
const note = await data.get<DataType.Note, Note>(noteId)
|
||||
|
||||
if (note) {
|
||||
return { note, from: 'sha' }
|
||||
return { note, from: "sha" }
|
||||
}
|
||||
|
||||
if (notePath) {
|
||||
@@ -33,7 +33,7 @@ export const prepareNoteCache = (sha: string, path?: string) => {
|
||||
}
|
||||
return {
|
||||
note,
|
||||
from: 'path'
|
||||
from: "path"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { computed } from "vue"
|
||||
|
||||
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
|
||||
|
||||
export const useFolderNotes = (folders: string[]) => {
|
||||
@@ -8,8 +9,8 @@ export const useFolderNotes = (folders: string[]) => {
|
||||
store.files.filter(
|
||||
(file) =>
|
||||
folders.some((folder) => file.path?.startsWith(folder)) &&
|
||||
file.path?.endsWith(".md"),
|
||||
),
|
||||
file.path?.endsWith(".md")
|
||||
)
|
||||
)
|
||||
|
||||
const content = computed(() =>
|
||||
@@ -23,10 +24,10 @@ export const useFolderNotes = (folders: string[]) => {
|
||||
})`
|
||||
})
|
||||
.join("\n")
|
||||
: "",
|
||||
: ""
|
||||
)
|
||||
|
||||
return {
|
||||
content,
|
||||
content
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ export const useNotes = () => {
|
||||
const store = useUserRepoStore()
|
||||
|
||||
const notes = computed(() =>
|
||||
store.files.filter((file) => file.path?.endsWith(".md")),
|
||||
store.files.filter((file) => file.path?.endsWith(".md"))
|
||||
)
|
||||
|
||||
return {
|
||||
notes,
|
||||
notes
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DataType } from '@/data/DataType.enum'
|
||||
import { Model } from '@/data/models/Model'
|
||||
import { Backlink } from '@/modules/note/models/Backlink'
|
||||
import { DataType } from "@/data/DataType.enum"
|
||||
import { Model } from "@/data/models/Model"
|
||||
import { Backlink } from "@/modules/note/models/Backlink"
|
||||
|
||||
export interface BacklinkNote extends Model<DataType.BacklinkNote> {
|
||||
sha: string
|
||||
|
||||
Reference in New Issue
Block a user