-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from TritonSE/feature/christenjack/storage
Feature/christenjack/storage
- Loading branch information
Showing
117 changed files
with
4,562 additions
and
3,140 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
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
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
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 |
---|---|---|
@@ -1,47 +1,28 @@ | ||
import { body } from "express-validator"; | ||
|
||
const makeIDValidator = () => | ||
body("_id") | ||
const makeNameValidator = () => | ||
body("name") | ||
.exists() | ||
.withMessage("_id is required") | ||
.withMessage("name is required") | ||
.bail() | ||
.isString() | ||
.withMessage("_id must be a number"); | ||
const makePageValidator = () => | ||
body("page") | ||
.exists() | ||
.withMessage("image is required") | ||
.bail() | ||
.isString() | ||
.withMessage("image must be a string"); | ||
const makeSubtitleValidator = () => | ||
body("ph_subtitle") | ||
.exists() | ||
.withMessage("subtitle is required") | ||
.bail() | ||
.isString() | ||
.withMessage("subtitle must be a string"); | ||
const makeTitleValidator = () => | ||
body("s1_title") | ||
.withMessage("name must be a string"); | ||
|
||
const makeEditedValidator = () => | ||
body("isEdited") | ||
.exists() | ||
.withMessage("date is required") | ||
.withMessage("isEdited is required") | ||
.bail() | ||
.isString() | ||
.withMessage("date must be a string"); | ||
const makeTextValidator = () => | ||
body("s1_text") | ||
.isBoolean() | ||
.withMessage("isEdited must be a boolean"); | ||
|
||
const makeFieldsValidator = () => | ||
body("fields") | ||
.exists() | ||
.withMessage("content is required") | ||
.withMessage("fields is required") | ||
.bail() | ||
.isString() | ||
.withMessage("content must be a string"); | ||
|
||
export const getPageEditor = [makePageValidator()]; | ||
.isArray() | ||
.withMessage("fields must be an array"); | ||
|
||
export const createPageEditor = [ | ||
makeIDValidator(), | ||
makePageValidator(), | ||
makeSubtitleValidator(), | ||
makeTitleValidator(), | ||
makeTextValidator(), | ||
]; | ||
export const getPageEditor = [makeNameValidator(), makeEditedValidator(), makeFieldsValidator()]; | ||
export const updatePageEditor = [makeNameValidator(), makeEditedValidator(), makeFieldsValidator()]; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.