Skip to content

Commit

Permalink
fix: check the existence of publication, license and copyright before…
Browse files Browse the repository at this point in the history
… the accession
  • Loading branch information
michaelwenk committed Jan 17, 2024
1 parent 9bafb7f commit 5f704ff
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions cmd/mb3server/src/api-impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ func GetRecord(accession string) (*MbRecord, error) {
Modified: record.Date.Modified.String(),
},
Authors: nil,
License: *record.License,
Copyright: *record.Copyright,
Publication: *record.Publication,
License: "",
Copyright: "",
Publication: "",
Project: "",
Comments: nil,
Compound: MbRecordCompound{
Expand Down Expand Up @@ -304,6 +304,18 @@ func GetRecord(accession string) (*MbRecord, error) {
},
},
}
// insert publication, license, copyright
if record.Publication != nil {
result.Publication = *record.Publication
}
if record.License != nil {
result.License = *record.License
}
if record.Copyright != nil {
result.Copyright = *record.Copyright
}

// insert authors
for _, author := range *record.Authors {
result.Authors = append(result.Authors, AuthorsInner{
Name: author.Name,
Expand All @@ -325,7 +337,6 @@ func GetRecord(accession string) (*MbRecord, error) {

// insert annotation data
if record.Peak.Annotation != nil {

result.Peak.Annotation.Header = record.Peak.Annotation.Header

var annotationValues = [][]string{}
Expand Down

0 comments on commit 5f704ff

Please sign in to comment.