-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend/frontend] Fix editing challenge
- Loading branch information
1 parent
d20c8e3
commit a3f475e
Showing
8 changed files
with
126 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 0 additions & 103 deletions
103
openbas-api/src/main/java/io/openbas/rest/challenge/form/ChallengeCreateInput.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
openbas-api/src/main/java/io/openbas/rest/challenge/form/ChallengeInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.openbas.rest.challenge.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import lombok.Data; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import static io.openbas.config.AppConfig.EMPTY_MESSAGE; | ||
import static io.openbas.config.AppConfig.MANDATORY_MESSAGE; | ||
|
||
@Data | ||
public class ChallengeInput { | ||
|
||
@NotBlank(message = MANDATORY_MESSAGE) | ||
@JsonProperty("challenge_name") | ||
private String name; | ||
|
||
@JsonProperty("challenge_category") | ||
private String category; | ||
|
||
@JsonProperty("challenge_content") | ||
private String content; | ||
|
||
@JsonProperty("challenge_score") | ||
private Double score; | ||
|
||
@JsonProperty("challenge_max_attempts") | ||
private Integer maxAttempts; | ||
|
||
@JsonProperty("challenge_tags") | ||
private List<String> tagIds = new ArrayList<>(); | ||
|
||
@JsonProperty("challenge_documents") | ||
private List<String> documentIds = new ArrayList<>(); | ||
|
||
@NotEmpty(message = EMPTY_MESSAGE) | ||
@JsonProperty("challenge_flags") | ||
private List<FlagInput> flags = new ArrayList<>(); | ||
|
||
} |
103 changes: 0 additions & 103 deletions
103
openbas-api/src/main/java/io/openbas/rest/challenge/form/ChallengeUpdateInput.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.