Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
remove restriction 2gb
Browse files Browse the repository at this point in the history
  • Loading branch information
mgilangjanuar committed Mar 29, 2022
1 parent 4d7cc04 commit c968491
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion server/src/api/v1/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Request, Response } from 'express'
import { sign, verify } from 'jsonwebtoken'
import { serializeError } from 'serialize-error'
import { getRepository } from 'typeorm'
import { Users } from '../../model//entities/Users'
import { Users } from '../../model/entities/Users'
import { Files } from '../../model/entities/Files'
import { Redis } from '../../service/Cache'
import { CONNECTION_RETRIES, COOKIE_AGE, TG_CREDS } from '../../utils/Constant'
Expand Down Expand Up @@ -88,6 +88,7 @@ export class Auth {
const username = userAuth.username || userAuth.phone || phoneNumber
user = await getRepository<Users>(Users).save({
username,
plan: 'premium',
name: `${userAuth.firstName || ''} ${userAuth.lastName || ''}`.trim() || username,
tg_id: userAuth.id.toString()
}, { reload: true })
Expand Down Expand Up @@ -227,6 +228,7 @@ export class Auth {
const username = userAuth.username || userAuth.phone
user = await getRepository<Users>(Users).save({
username,
plan: 'premium',
name: `${userAuth.firstName || ''} ${userAuth.lastName || ''}`.trim() || username,
tg_id: userAuth.id.toString()
}, { reload: true })
Expand Down Expand Up @@ -306,6 +308,7 @@ export class Auth {
const username = userAuth['username'] || userAuth['phone']
user = await getRepository<Users>(Users).save({
username,
plan: 'premium',
name: `${userAuth['firstName'] || ''} ${userAuth['lastName'] || ''}`.trim() || username,
tg_id: userAuth.id.toString()
}, { reload: true })
Expand All @@ -322,6 +325,7 @@ export class Auth {
const username = userAuth['username'] || userAuth['phone']
user = await getRepository<Users>(Users).save({
username,
plan: 'premium',
name: `${userAuth['firstName'] || ''} ${userAuth['lastName'] || ''}`.trim() || username,
tg_id: userAuth.id.toString()
}, { reload: true })
Expand Down
16 changes: 8 additions & 8 deletions web/src/pages/dashboard/components/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ const Upload: React.FC<Props> = ({ dataFileList: [fileList, setFileList], parent
const params = {
multiple: true,
customRequest: upload,
beforeUpload: (file: any) => {
if (file.size > 2_000_000_000 && (!me?.user.plan || me?.user.plan === 'free')) {
notification.error({
message: 'Error',
description: 'Maximum file size is 2 GB. Upgrade your plan to upload larger files.'
})
return false
}
beforeUpload: (_file: any) => {
// if (file.size > 2_000_000_000 && (!me?.user.plan || me?.user.plan === 'free')) {
// notification.error({
// message: 'Error',
// description: 'Maximum file size is 2 GB. Upgrade your plan to upload larger files.'
// })
// return false
// }
return true
},
fileList: fileList,
Expand Down

0 comments on commit c968491

Please # to comment.