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
@Post('/image') | |
@FormDataRequest() | |
async uploadFileToS3(@Res() res: Response, @Body() file: any) { | |
const key = this.configService.get('AWS_COMPENSATION_KEY_PATH'); | |
const bucket = this.configService.get('AWS_PUBLIC_BUCKET_NAME'); | |
const region = this.configService.get('AWS_REGION'); | |
const fileType = file as { document: MemoryStoredFile }; | |
const s3File = await this.fileStorageService.UploadFile( |
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 BxIcons from '@bx-design/react-icons' | |
import { uploadImageToS3 } from 'api/compensation' | |
import { useCompensationPhotographicEvidence } from 'atoms/compensation/hooks/compensation' | |
import { Label } from 'components/ui-bx/forms' | |
import { useRef, useState, DragEvent } from 'react' | |
import styles from './photographic-evidence.module.scss' | |
import formStyles from './forms.module.scss' | |
import { | |
DeepMap, |
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 { FC } from 'react'; | |
type Props = { | |
width?: number; | |
height?: number; | |
inverted?: boolean; | |
}; | |
const LogoBx: FC<Props> = ({ inverted = false, height, width }) => { | |
return ( |
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 rutPattern = (): RegExp => /^(\d{0,2})\.?(\d{3})\.?(\d{3})-?(\d|k)$/gi; | |
const companyRutPattern = (): RegExp => | |
/^([5-9]{1}[0-9]{1})\.?(\d{3})\.?(\d{3})-?(\d|k)$/gi; | |
const fakeRutPattern = (): RegExp => /^(\d)\1?\.?(\1{3})\.?(\1{3})-?(\d|k)?$/gi; | |
export const isRutValid = (rut: string): boolean => rutPattern().test(rut); | |
export const isFakeRut = (rut: string): boolean => fakeRutPattern().test(rut); | |
export const isCompanyRut = (rut: string): boolean => | |
companyRutPattern().test(rut); |
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, { AxiosError, AxiosRequestConfig } from 'axios'; | |
import * as configApp from 'config'; | |
declare module 'axios' { | |
interface AxiosRequestConfig { | |
handlerEnabled?: boolean; | |
_retry?: boolean; | |
} | |
} |
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 React, { createContext, useReducer, useContext, useEffect, useCallback } from 'react' | |
import { Platform } from 'react-native' | |
import Constants from 'expo-constants' | |
import * as Location from 'expo-location' | |
import { getCenter, getDistance } from 'geolib' | |
const CheckStateContext = createContext() | |
const CheckDispatchContext = createContext() | |
const initialState = { |
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 React, { useRef } from 'react' | |
import { useWindowDimensions } from 'react-native' | |
import MapView, { Marker } from 'react-native-maps' | |
import styled from 'styled-components/native' | |
import { useCheckState } from '../contexts/check-context' | |
import { getDelta } from '../utils/getDelta' | |
export default function CheckModalContent () { | |
const window = useWindowDimensions() | |
const { position, initialRegion, distance, center, errorMsg } = useCheckState() |
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
// Enter the day you would like to create | |
WITH { day: 18, month: 1, year: 2014 } as dayMap | |
// Merge hours in a day | |
MERGE (thisDay:Day { day: dayMap.day, month: dayMap.month, year: dayMap.year }) | |
MERGE (firstHour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: 1 }) | |
CREATE (thisDay)-[:FIRST]->(firstHour) | |
FOREACH (i IN tail(range(1, 24)) | | |
MERGE (thishour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: i }) | |
MERGE (lasthour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: i - 1 }) |
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 express = require('express') | |
const { createTask, getTasks } = require('../services/task') | |
const { | |
taskSchema | |
} = require('../utils/schemas/task') | |
const validationHandler = require('../utils/middleware/validationHandler') | |
const taskApi = app => { |
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 connectDB = require('./db') | |
const { ObjectID } = require('mongodb') | |
module.exports = { | |
createTask: async ({ task }) => { | |
const inputTask = Object.assign(task) | |
let db | |
let newTask | |
try { |