refactor: word

This commit is contained in:
Methapon2001 2023-11-27 14:11:27 +07:00
parent d8cf568206
commit 3820a05704
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
12 changed files with 56 additions and 56 deletions

View file

@ -1,4 +1,4 @@
import { EhrFile } from "../interfaces/ehr-fs";
import { StorageFile } from "../interfaces/storage-fs";
import esClient from "../elasticsearch";
import minioClient from "../minio";
@ -48,7 +48,7 @@ export async function handler(key: string, event: string): Promise<boolean> {
// Get info and delete it from ElasticSearch to re-index
async function popInfo(pathname: string) {
const result = await esClient
.search<EhrFile & { attachment?: Record<string, unknown> }>({
.search<StorageFile & { attachment?: Record<string, unknown> }>({
index: DEFAULT_INDEX!,
query: { match: { pathname } },
})
@ -111,7 +111,7 @@ async function handleNotFoundRecord(
createdBy: "n/a",
updatedAt: new Date().toISOString(),
updatedBy: "n/a",
} satisfies Partial<EhrFile>;
} satisfies Partial<StorageFile>;
const result = await esClient
.index({
@ -127,7 +127,7 @@ async function handleNotFoundRecord(
}
async function handleFoundRecord(
metadata: EhrFile,
metadata: StorageFile,
buffer: Buffer,
stat: { size: number; type: string },
) {