Skip to content

Commit

Permalink
feat(api): remove unused mime format and handle null
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Apr 25, 2024
1 parent d1ad503 commit d1e2171
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,22 @@ export class RecordApiFormComponent {
? this.apiBaseUrl.slice(0, -1)
: this.apiBaseUrl

this.getOutputFormats(apiUrl).then((outputFormats) => {
this.getOutputFormats(
'https://demo.ldproxy.net/zoomstack/collections/airports/items'
).then((outputFormats) => {
const formatsList = outputFormats.itemFormats.map((format) => {
const normalizedFormat = mimeTypeToFormat(format)
return {
label: normalizedFormat.toUpperCase(),
value: normalizedFormat,
if (normalizedFormat) {
return {
label: normalizedFormat?.toUpperCase(),
value: normalizedFormat,
}
}
return null
})
this.outputFormats = this.outputFormats.concat(formatsList)
this.outputFormats = this.outputFormats.concat(
formatsList.filter(Boolean)
)
this.outputFormats = this.outputFormats
.filter(
(format, index, self) =>
Expand Down
6 changes: 0 additions & 6 deletions libs/util/shared/src/lib/links/link-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ export const FORMATS = {
'application/vnd.ogc.fg+json;compatibility=geojson',
],
},
pap: {
extensions: ['pap'],
priority: 15,
color: '#f2bb3a',
mimeTypes: ['application/vnd.policy.attributes'],
},
} as const

export type FileFormat = keyof typeof FORMATS
Expand Down

0 comments on commit d1e2171

Please sign in to comment.