Skip to content

Commit

Permalink
Merge pull request #1884 from sul-dlss/sort-types
Browse files Browse the repository at this point in the history
Sort generated types json before writing to file
  • Loading branch information
cbeer authored Oct 2, 2023
2 parents 64fa7ad + 7c7d8f2 commit bfdbd6e
Show file tree
Hide file tree
Showing 13 changed files with 7,590 additions and 7,590 deletions.
4 changes: 2 additions & 2 deletions app/services/folio/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def sync!

types_of_interest.each do |type|
file = cache_dir.join("#{type}.json")

File.write(file, JSON.pretty_generate(folio_client.public_send(type)))
data = folio_client.public_send(type).sort_by { |item| item['id'] }
File.write(file, JSON.pretty_generate(data))
end

circulation_rules = folio_client.circulation_rules
Expand Down
40 changes: 20 additions & 20 deletions config/folio/campuses.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
[
{
"id": "b89563c5-cb66-4de7-b63c-ca4d82e9d856",
"name": "Graduate School of Business",
"code": "GSB",
"id": "40b76104-95ea-4360-a2be-5fd887222e2d",
"name": "Medical Center",
"code": "MED",
"institutionId": "8d433cdd-4e8f-4dc1-aa24-8a4ddb7dc929",
"metadata": {
"createdDate": "2023-08-10T17:44:44.519+00:00",
"createdDate": "2023-08-10T17:44:45.387+00:00",
"createdByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766",
"updatedDate": "2023-08-10T17:44:44.519+00:00",
"updatedDate": "2023-08-10T17:44:45.387+00:00",
"updatedByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766"
}
},
{
"id": "be6468b8-ed88-4876-93fe-5bdac764959c",
"name": "Hoover Institution",
"code": "HOOVER",
"id": "7003123d-ef65-45f6-b469-d2b9839e1bb3",
"name": "Law School",
"code": "LAW",
"institutionId": "8d433cdd-4e8f-4dc1-aa24-8a4ddb7dc929",
"metadata": {
"createdDate": "2023-08-10T17:44:45.017+00:00",
"createdDate": "2023-08-10T17:44:45.217+00:00",
"createdByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766",
"updatedDate": "2023-08-10T17:44:45.017+00:00",
"updatedDate": "2023-08-10T17:44:45.217+00:00",
"updatedByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766"
}
},
{
"id": "7003123d-ef65-45f6-b469-d2b9839e1bb3",
"name": "Law School",
"code": "LAW",
"id": "b89563c5-cb66-4de7-b63c-ca4d82e9d856",
"name": "Graduate School of Business",
"code": "GSB",
"institutionId": "8d433cdd-4e8f-4dc1-aa24-8a4ddb7dc929",
"metadata": {
"createdDate": "2023-08-10T17:44:45.217+00:00",
"createdDate": "2023-08-10T17:44:44.519+00:00",
"createdByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766",
"updatedDate": "2023-08-10T17:44:45.217+00:00",
"updatedDate": "2023-08-10T17:44:44.519+00:00",
"updatedByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766"
}
},
{
"id": "40b76104-95ea-4360-a2be-5fd887222e2d",
"name": "Medical Center",
"code": "MED",
"id": "be6468b8-ed88-4876-93fe-5bdac764959c",
"name": "Hoover Institution",
"code": "HOOVER",
"institutionId": "8d433cdd-4e8f-4dc1-aa24-8a4ddb7dc929",
"metadata": {
"createdDate": "2023-08-10T17:44:45.387+00:00",
"createdDate": "2023-08-10T17:44:45.017+00:00",
"createdByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766",
"updatedDate": "2023-08-10T17:44:45.387+00:00",
"updatedDate": "2023-08-10T17:44:45.017+00:00",
"updatedByUserId": "58d0aaf6-dcda-4d5e-92da-012e6b7dd766"
}
},
Expand Down
Loading

0 comments on commit bfdbd6e

Please sign in to comment.