Skip to content

Commit

Permalink
simplify toFindspotDto
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Feb 2, 2024
1 parent c42471a commit 43cf3d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions src/fragmentarium/domain/archaeology.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Reference from 'bibliography/domain/Reference'
import { Provenances } from 'corpus/domain/provenance'
import _ from 'lodash'
import { immerable } from 'immer'

export const excavationSites = {
..._.omit(Provenances, 'Standard Text'),
Expand Down Expand Up @@ -63,8 +62,6 @@ function padRight(s: string | number | null, right = ' '): string {
}

export class Findspot {
readonly [immerable] = true

constructor(
readonly id: number,
readonly site: ExcavationSite = excavationSites[''],
Expand Down
10 changes: 1 addition & 9 deletions src/fragmentarium/domain/archaeologyDtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,9 @@ export function fromFindspotDto(dto: FindspotDto): Findspot {

export function toFindspotDto(findspot: Findspot): FindspotDto {
return {
..._.omit(findspot, 'id'),
_id: findspot.id,
area: findspot.area,
building: findspot.building,
buildingType: findspot.buildingType,
levelLayerPhase: findspot.levelLayerPhase,
room: findspot.room,
context: findspot.context,
primaryContext: findspot.primaryContext,
notes: findspot.notes,
site: findspot.site.name as SiteKey,
dateRange: findspot.dateRange,
plans: findspot.plans.map(toPlanDto),
}
}

0 comments on commit 43cf3d7

Please sign in to comment.