Controllers/CitizenController

Controller handles the logic for any citizen related routes.

Source:

Methods

(static) delete()

Source:

placeholder route that would handle deletion of citizen currently this just removes all info on our 1 user

DELETE

/citizens

(async, static) deleteInfo()

Source:

DELETE Delete info for one or more steps based on JSON request. /citizens/deleteInfo

Parameters:
Name Type Attributes Description
req.body.input String <repeatable>

Names of the steps to delete

(static) index()

Source:

GET

placeholder route that would get all of the citizens and their info

/citizens

(async, static) postMultipleSteps()

Source:

Posts the provided steps.

Appends new values to existing steps if a list of values is supplied, otherwise edits steps that are already presesent with a new value !! It's up to the sender of the request to verify that multiple values make sense for a specific step

Route: /citizens/addInfo

Parameters:
Name Type Description
req.body.input Object

Key value pairs with stepnames as keys and their values

(async, static) postStep()

Source:

Posts the provided step.

Appends new values if step already exists and if a list of values is supplied, otherwise edits the step with a new value

!! It's up to the sender of the request to verify that multiple values make sense for a specific step

Route: /citizens/step/:step

Parameters:
Name Type Description
req.params.step String

Name of the step used

req.body.input.value String | Array.<String>

Value(s) of the corresponding step

(async, static) putMultipleSteps()

Source:

Puts the provided steps.

Overwrites existing steps if a list of values is supplied or if multiple values are already present, otherwise edits steps that are already presesent with a new value

!! It's up to the sender of the request to verify that multiple values make sense for a specific step,

Route: /citizens/addInfo

Parameters:
Name Type Description
req.body.input Object

Key value pairs with stepnames as keys and their values

(async, static) putStep()

Source:

Puts the provided step.

Overwrites if existing step has multiple values, otherwise edits already presesent value with provided value.

!! It's up to the sender of the request to verify that multiple values make sense for a specific step,

Route: /citizens/step/:step

Parameters:
Name Type Description
req.params.step String

Name of the step used

req.body.input.value String | Array.<String>

Value(s) of the corresponding step

(async, static) showStep()

Source:

GET and POST, depends on which type of data user (solid or stored here)

Show info for a specific step (based on route, eg /citizens/step/providePhoneNumberManually)

/citizens/step/:step

Parameters:
Name Type Description
req.params.step String

Name of the step used

(async, static) undoStep()

Source:

DELETE

delete info for a specific step (based on route, eg /citizens/step/providePhoneNumberManually)

/citizens/step/:step

Parameters:
Name Type Description
req.params.step String

Name of the step used