This file contains hidden or 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 net from 'net'; | |
| import tls from 'tls'; | |
| import { URL } from 'url'; | |
| import { config } from 'dotenv'; | |
| config(); | |
| const DATABASE_URL = process.env.DATABASE_URL; | |
| if (!DATABASE_URL) { |
This file contains hidden or 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 boxRef = React.useRef<HTMLDivElement>(null); | |
| React.useEffect(() => { | |
| if (!boxRef.current) return; | |
| runAnimation(boxRef.current, isOpen); | |
| }, [isOpen]);*/ | |
| export const runAnimation = (box: HTMLDivElement, isOpen: boolean) => { |
This file contains hidden or 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
| // buy a subscription | |
| const session = await stripe.checkout.sessions.create({ | |
| customer: customerID, | |
| success_url: '/settings/subscription', | |
| cancel_url: '/settings/subscription', | |
| line_items: [{ price: somePrice, quantity }], | |
| subscription_data: { trial_period_days: 60 }, | |
| mode: 'subscription', | |
| }); |
This file contains hidden or 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 requests = await RequestModel.findAll({ | |
| include: { | |
| model: UserModel, | |
| where: { user_id: ids }, | |
| as: 'users', | |
| attributes: [], | |
| through: { model: UserRequestModel, attributes: [] }, | |
| }, | |
| attributes: [], | |
| group: ['request.id'], |
This file contains hidden or 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 handleProgressChange = (fileUploadingChannel, progressValue) => { | |
| fileUploadingChannel.put({ value: progressValue }) | |
| } | |
| function* handleFilesUploadingEvents(fileUploadingChannel) { | |
| while(true) { | |
| const payload = yield take(fileUploadingChannel); | |
| yield put({ | |
| type: FILES_UPLOADING_PROGRESS, | |
| payload |
This file contains hidden or 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
| function* authorize(user, password) { | |
| try { | |
| const token = yield call(Api.authorize, user, password); | |
| yield put({ type: 'LOGIN_SUCCESS', token }); | |
| yield call(Api.saveToken, token); | |
| } catch(error) { | |
| yield put({ type: 'LOGIN_ERROR', error }); | |
| } finally { | |
| if (yield cancelled()) yield put({type: 'STOP_LOADING'}); | |
| } |