Skip to content

Instantly share code, notes, and snippets.

View gcmatheusj's full-sized avatar
Working in awesome projects

Matheus Castro gcmatheusj

Working in awesome projects
View GitHub Profile
import UserProvider from '../models/UserProvider';
import Provider from '../models/Provider';
import MedicalExam from '../models/MedicalExam';
class MedicalExamController {
async store(req, res) {
const { provider } = await UserProvider.findOne({
where: { user_id: req.userId },
include: [
{
import React from 'react';
import { FieldProps, getIn } from 'formik';
import { Chip, TextField } from '@material-ui/core';
import Autocomplete from '@material-ui/lab/Autocomplete';
import useStyles from './styles';
export default function InputMultiValue({ field, form, ...props }: FieldProps) {
const classes = useStyles({});
const account = require('./account/graphql')
const user = require('./user/graphql')
const prepared = prepareGraphql([account, user])
const {
schema,
resolvers
} = prepared
const typeDefs = gql`${schema}`
import styled, { css } from 'styled-components';
import PerfectScrollBar from 'react-perfect-scrollbar';
import { lighten } from 'polished';
export const Container = styled.div`
position: relative;
`;
export const Badge = styled.button`
background: none;
import React from 'react';
import styled, { css } from 'styled-components';
export default function StatusProgress({ type }) {
return (
<Line type={type}>
<Circle type={type} />
<Circle type={type} />
<Circle type={type} />
<Circle type={type} />
const Post = require("../models/Post");
const index = async (req, res) => {
const posts = await Post.find();
return res.json(posts);
};
const store = async (req, res) => {
const { originalname: name, size, key, location: url = "" } = req.file;
@gcmatheusj
gcmatheusj / AcademicController.js
Created August 1, 2019 00:29
Backend - File Upload
import AcademicSubscription from '../models/AcademicSubscription';
class AcademicController {
async store(req, res) {
const { originalname: name, filename: path } = req.file;
const academicSubscription = await AcademicSubscription.create({
...req.body,
name,
path,
import React, { Fragment } from 'react';
import { withFormik, FormikProps, FieldArray } from 'formik';
import * as Yup from 'yup';
import styled from 'styled-components';
import { History } from 'history';
import AddPollMutation from './AddPollMutation';
import withToast from '../HOC/withToast';
import Header from '../common/Header/Header';