Skip to content
Snippets Groups Projects
Commit 24809502 authored by Stephanie Briere Americo's avatar Stephanie Briere Americo
Browse files

Merge branch 'issue/73' into 'develop'

Issue #73: FIX Creating subform input needs input ID

Closes #73

See merge request !72
parents 097d6425 59c79028
No related branches found
No related tags found
1 merge request!72Issue #73: FIX Creating subform input needs input ID
Pipeline #23088 passed
......@@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.2.3 - 29/04/2020
## Changed
- Api to create a subform input without needing input ID from body #73 (Richard Heise)
- OptHandler to not return error when there's no input ID
- Subform in core/ to have an optional input ID
## 1.2.2 - 07-04-2020
## Added
- Route to return the number of answers in a form #72 (Richard Heise)
......
{
"name": "form-creator-api",
"version": "1.2.2",
"version": "1.2.3",
"description": "RESTful API used to manage and answer forms.",
"main": "index.js",
"scripts": {
......
......@@ -28,7 +28,7 @@ export interface SubFormOptions {
id?: number;
/** Input wich subForm is linked. */
inputId: number;
inputId?: number;
/** SubForm of a form. */
contentFormId: number;
......@@ -52,7 +52,7 @@ export class SubForm {
*/
constructor(options: SubFormOptions) {
this.id = options.id ? options.id : null;
this.inputId = options.inputId;
this.inputId = options.inputId ? options.inputId : null;
this.contentFormId = options.contentFormId;
}
}
......@@ -287,9 +287,6 @@ export class OptHandler {
}
public static subForm(obj: any): SubForm {
if (obj.inputId === undefined) {
throw ErrorHandler.notFound("SubForm InputId");
}
if (obj.contentFormId === undefined) {
throw ErrorHandler.notFound("SubForm ContentForm");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment