Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/NeuronCore/WoW-CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
im-parsa committed Jul 20, 2023
2 parents 484aefe + 14fd99e commit 7ebfe5b
Show file tree
Hide file tree
Showing 8 changed files with 675 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Contributions are what make the open source community such an amazing place to b

## License

[//]: # (The WoW-CMS source is released under the [GNU AGPL v3](https://github.com/NeuronCore/WoW-CMS/blob/main/LICENSE))
- The WoW-CMS source is released under the [GNU AGPL v3](https://github.com/NeuronCore/WoW-CMS/blob/main/LICENSE)

## Links

Expand Down
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions apps/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"removeComments": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowUnreachableCode": true,
"baseUrl": ".",
"paths": { "@/*": ["./src/*"] }
},
Expand Down
5 changes: 1 addition & 4 deletions apps/server/src/blog/blog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export class BlogService
{
private logger: Logger = new Logger(BlogService.name);

constructor(
@Inject('AUTH_DATABASE') private authDatabase: Pool,
@Inject('WEB_DATABASE') private webDatabase: Pool
)
constructor(@Inject('WEB_DATABASE') private webDatabase: Pool)
{ }

public async create(accountID: number, createBlogDto: CreateBlogDto, thumbnail: Express.Multer.File)
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/payment/payment.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export abstract class PaymentGateway

export class ZarinPalGateway implements PaymentGateway
{
constructor(private authDatabase: Pool, private webDatabase: Pool)
constructor(private webDatabase: Pool)
{ }

public async request(accountID: number, requestDto: RequestDto, response: Response)
Expand Down
9 changes: 3 additions & 6 deletions apps/server/src/payment/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ import { RequestDto } from '@/payment/dto/request.dto';
@Injectable()
export class PaymentService
{
constructor(
@Inject('AUTH_DATABASE') private authDatabase: Pool,
@Inject('WEB_DATABASE') private webDatabase: Pool
)
constructor(@Inject('WEB_DATABASE') private webDatabase: Pool)
{ }

public async request(accountID: number, requestDto: RequestDto, response: Response)
{
switch (Object.values(PaymentMethod).join())
{
case requestDto.paymentMethod:
await new ZarinPalGateway(this.authDatabase, this.webDatabase).request(accountID, requestDto, response);
await new ZarinPalGateway(this.webDatabase).request(accountID, requestDto, response);
break;
default:
return response.status(HttpStatus.BAD_GATEWAY).json({ statusCode: HttpStatus.BAD_GATEWAY, message: 'Unsupported payment method!' });
Expand All @@ -33,7 +30,7 @@ export class PaymentService
switch (Object.values(PaymentMethod).join())
{
case request.query.gateway:
await new ZarinPalGateway(this.authDatabase, this.webDatabase).verify(request, response);
await new ZarinPalGateway(this.webDatabase).verify(request, response);
break;
default:
return response.status(HttpStatus.BAD_GATEWAY).json({ statusCode: HttpStatus.BAD_GATEWAY, message: 'Unsupported payment method!' });
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/utils/email.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class Email
{
const template =
`
<h1>Forgot your password?</h1>
<h1>${ this.username } Forgot your password?</h1>
<p>Submit a patch request with your new password and password confirm to: <a href='${ this.url }'>Reset my password</a></p>
<p>Your password reset token (valid for only 10 minutes)</p>
<p>If you didn't forget your password, please ignore this email</p>
Expand Down
3 changes: 3 additions & 0 deletions apps/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowUnreachableCode": true,
"paths": { "@/*": ["./src/*"] }
}
}

0 comments on commit 7ebfe5b

Please sign in to comment.