see (https://aws.amazon.com/pt/solutions/video-on-demand-on-aws/)
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
'use strict'; | |
const modelName = 'page-content' | |
module.exports = { | |
_validate(data) { | |
if (!(data.startAt < data.endAt)){ | |
throw new Error("startAt should be less than endAt date") | |
} |
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
'use strict'; | |
const modelName = 'link'; | |
function isValidUrl(string) { | |
try { | |
new URL(string); | |
} catch (_) { | |
return false; | |
} |
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
'use strict'; | |
const _ = require('lodash'); | |
module.exports = { | |
fetchAll(params, query) { | |
const { query: request, populate, ...filters } = query; | |
const queryFilter = !_.isEmpty(request) | |
? { |
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
const { expect } = require('chai'); | |
describe('strapi.services.link', () => { | |
describe('#create', () => { | |
context('with invalid data', () => { | |
it('should fails', async () => { | |
try { | |
await strapi.services.link.create({ | |
name: "invalid", | |
url: 'invalid-url-formt' |
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
const strapi = require('strapi')(); | |
before((done) => { | |
strapi.start(() => { | |
done() | |
}); | |
}); | |
after(() => { | |
strapi.stop(0); |
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
const strapi = require('strapi')(); | |
/* | |
* nossa nova função start | |
* não iniciar servidor http | |
* nem printa nada na tela | |
*/ | |
const start = async function(cb) { | |
try { | |
await this.load(); |
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
--recursive | |
--reporter spec | |
--file ./test/setup.js | |
--timeout 20000 |
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
<script> | |
const configValues = document.cookie.split('; ').find(c => c.startsWith('config')).split('=')[1] | |
const config = JSON.parse(window.unescape(config)) | |
</scrip> |
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
sql_string_value <- function(value) { | |
return(ifelse(is.null(value) | is.na(value),"''", paste0("'", gsub("'", "", value), "'"))) | |
} | |
sql_timestamp_value <- function(value) { | |
return(paste0("date(timestamp'", value, "')")) | |
} | |
sql_numeric_value <- function(value) { | |
return(ifelse(is.null(value) | is.na(value), '0', value)) |