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
<template> | |
<div class="modal is-active" v-if="active"> | |
<div class="modal-background"></div> | |
<div class="container"> | |
<div class="card"> | |
<header class="modal-card-head"> | |
<button class="delete" aria-label="close" @click="closeModal"></button> | |
</header> | |
<section class="modal-card-body"> | |
<div class="columns"> |
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
package br.com.gleac.seguranca; | |
import br.com.gleac.entidade.seguranca.RecursoSistema; | |
import br.com.gleac.negocio.RecursoSistemaRepository; | |
import com.fasterxml.jackson.core.JsonEncoding; | |
import com.fasterxml.jackson.core.JsonFactory; | |
import com.fasterxml.jackson.core.JsonGenerator; | |
import com.fasterxml.jackson.core.JsonParseException; | |
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; | |
import com.google.common.collect.Lists; |
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 { execQuery } = require('../../support/wrapQuery') | |
const { filterBy, insertBy } = require('../../support/wrapRepository') | |
const knex = require('../../config/db') | |
const query = knex('users') | |
const filterUserByUsername = (req) => { | |
const filterByUsername = filterBy('username', req.body.username) | |
return execQuery(filterByUsername, query) | |
.then(result => { | |
console.log(' result ' + resul) |
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 knex = require('../../config/db') | |
const baseUsers = knex('users') | |
const tryCatch = fn => { | |
try { | |
return Promise.resolve(fn()) | |
} catch (e) { | |
return Promise.reject(e) | |
} | |
} |
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 getName = (path) => (domain) => `${path}-${domain}`.replace(/[~!@#$%^&*()_|+\=?;:,.<>\{\}\[\]\\\/]/gi, '') | |
const version = 'v1.0.0' | |
const methods = ['post', 'get', 'delete', 'put'] | |
const getMethod = (method) => methods.find((elem) => elem === method) | |
const create = (path) => (handler) => { | |
const method = getMethod('post') | |
const name = getName(path)('create') |
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 opts = { | |
schema: { | |
response: { | |
200: { | |
type: 'object', | |
properties: { | |
ok: { type: 'string' } | |
} | |
} | |
} |
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 path = require('path') | |
const filterFiles = require('filter-files') | |
const isDir = require('is-directory') | |
const { flatten } = require('lodash') | |
const isRouteFile = fileName => /((Route)|(Routes))\.js$/.test(fileName) | |
/** | |
* @method getRoutesFilesFromDirname | |
* @param {String} dirName | |
* @return {Array<String>} |
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
import axios from 'axios' | |
export const http = axios.create({ baseURL: 'suaUrlAqui' }) | |
export default function install ( Vue ) { | |
Object.defineProperty(Vue.prototype, '$http', { | |
get: () => http | |
}) | |
} |