WIP jordan
This commit is contained in:
12
app/composables/usePdfFieldMappings.ts
Normal file
12
app/composables/usePdfFieldMappings.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { PdfFieldMappingFile } from '~/types/pdf-field-mapping'
|
||||
import mappingsJson from '~/data/pdf-field-mappings.json'
|
||||
|
||||
const file = mappingsJson as PdfFieldMappingFile
|
||||
|
||||
export function usePdfFieldMappings() {
|
||||
function mappingForCatalogFormId(catalogFormId: number) {
|
||||
return file.mappings.find((m) => m.catalogFormId === catalogFormId) ?? null
|
||||
}
|
||||
|
||||
return { version: file.version, mappingForCatalogFormId, mappings: file.mappings }
|
||||
}
|
||||
Reference in New Issue
Block a user