Skip to content

Latest commit

 

History

History
133 lines (117 loc) · 3.23 KB

Services.md

File metadata and controls

133 lines (117 loc) · 3.23 KB

Services

Municipality

This service returns name, path, county and code for given municipality code.

Map and menuDropDown are currently using this.

Methods

get(req)

  • If req.params.code is a municipal code, the data about that municipality is returned.

Dashboard

Used to update, create or delete datasets based on dataqueries

GET (should maybe be PUT?)

Update all:

{
    "id": "*"
}

Update one:

{
    "id": "some-dataquery-id"
}

Returns:

{
    "message": "Ingen ny data",
    "updates": [{
      "id": "1234134-sadf324afsd-2324saf324-324",
      "status": NO_NEW_DATA,
      "message": "Ingen ny data",
      "dataset": [{
        "newDatasetData": false,
        "modified": "26.05.2020 15:09:56",
        "modifiedReadable": "8 days ago"
      }],
      "logData": [{
        "queryId": "475e7964-6e28-48d8-9948-a20f44ecab5f",
        "modified": "03.06.2020 10:36:42",
        "by": {
            "type": "user",
            "key": "user:system:harry",
            "displayName": "Harry Potter",
            "disabled": false,
            "email": "[email protected]",
            "login": "harry",
            "idProvider": "system"
        },
        "modifiedTs": "2020-06-03T08:36:42.689Z",
        "modifiedResult": "NO_NEW_DATA",
        "message": "Ingen ny data",
        "modifiedReadable": "a few seconds ago"
      }]
    }]
}

DELETE
Delete datasets for all dataqueries

Delete all dataset:

{
    "id": "*"
}

Delete one dataset:

{
    "id": "some-dataquery-id"
}

Returns:

{
   "updates": [{
      "id": "475e7964-6e28-48d8-9948-a20f44ecab5f",
      "message": "Sletting gjennomført",
      "status": "DELETE_OK",
      "dataset": {
        "newDatasetData": true,
        "modified": "",
        "modifiedReadable": ""
      },
      "logData": {
      "queryId": "475e7964-6e28-48d8-9948-a20f44ecab5f",
      "modified": "03.06.2020 10:48:35",
      "by": {
        "type": "user",
        "key": "user:system:harry",
        "displayName": "Harry Potter",
        "disabled": false,
        "email": "[email protected]",
        "login": "harry",
        "idProvider": "system"
      },
      "modifiedTs": "2020-06-03T08:48:35.250Z",
      "modifiedResult": "DELETE_OK",
      "message": "Sletting gjennomført",
      "modifiedReadable": "a few seconds ago"
      }
    }],
    "message": "Sletting gjennomført",
    "publishResult": {
      "pushedContents": [],
      "deletedContents": ["d3742abc-8436-42fa-abf6-23891608fd5e"],
      "failedContents": []
    }
}

createContextOption(branch) (private)

Creates a context to be used for

Custom Selector Municipals

This is a service endpoint for a custom selector. It fetches all municipalities from KLASS, and return them in a format that custom selector needs.

At the moment it is used in SiteConfig to choose a default municiaplity for preview, and in municipalityAlert.

Methods:

get(req) : get list of municipalities win custom selector format