Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
teekay committed Jul 14, 2024
1 parent f17e668 commit 463eeac
Show file tree
Hide file tree
Showing 9 changed files with 2,834 additions and 2,803 deletions.
2 changes: 1 addition & 1 deletion src/api/api.queries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Types generated for queries found in "src/api/api.sql" */
import { PreparedQuery } from '@pgtyped/query'
import { PreparedQuery } from '@pgtyped/runtime'

/** 'LoginFromToken' parameters type */
export interface ILoginFromTokenParams {
Expand Down
2 changes: 1 addition & 1 deletion src/api/comments.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class CommentsController {
...comment,
postedAt: moment().utc().toDate(),
},
req.ip
req.ip ?? ''
)

if (req.headers['content-type'] !== 'application/json') {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/accounts/accounts.queries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Types generated for queries found in "src/shared/accounts/accounts.sql" */
import { PreparedQuery } from '@pgtyped/query'
import { PreparedQuery } from '@pgtyped/runtime'

/** 'Signup' parameters type */
export interface ISignupParams {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/auth/auth.queries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Types generated for queries found in "src/shared/auth/auth.sql" */
import { PreparedQuery } from '@pgtyped/query'
import { PreparedQuery } from '@pgtyped/runtime'

/** 'ExpirePendingTokens' parameters type */
export interface IExpirePendingTokensParams {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/comments/comments.queries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Types generated for queries found in "src/shared/comments/comments.sql" */
import { PreparedQuery } from '@pgtyped/query'
import { PreparedQuery } from '@pgtyped/runtime'

/** 'PostCommentForUrl' parameters type */
export interface IPostCommentForUrlParams {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/logging/logged-query.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash'
import { PreparedQuery } from '@pgtyped/query'
import { PreparedQuery } from '@pgtyped/runtime'

export function interpretedQuery(query: PreparedQuery<any, any>, params: Record<string, unknown>): string {
const templatedSql = (_.get(query, 'query.statement.body') as string) ?? ''
Expand Down
3 changes: 2 additions & 1 deletion src/web/accounts/account.closer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export class AccountCloser {
const payload = job.data
if (!isAccountCloserPayload(payload)) {
this.logger.error(`Unsupported payload ${JSON.stringify(payload)}`)
return
return Promise.resolve()
}
this.closeAccount(payload)
return Promise.resolve()
})
}

Expand Down
16 changes: 9 additions & 7 deletions src/web/dashboard/dashboard.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import moment from 'moment'
import { Request, Response } from 'express'
import { SessionExpiredFilter } from '../../shared/auth/auth.exception'

type GenericResponse = Response<any, Record<string, any>>;

@Controller('dashboard')
@UseFilters(new SessionExpiredFilter())
export class DashboardController {
Expand Down Expand Up @@ -83,7 +85,7 @@ export class DashboardController {

@Post('comment/delete')
@UseGuards(AuthenticatedGuard)
async deleteSingleComment(@Req() req: Request, @Res() res: Response, @Body() id: Identifiable): Promise<void> {
async deleteSingleComment(@Req() req: Request, @Res() res: Response, @Body() id: Identifiable): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
const comment = await this.commentService.findById(account, id.id)
if (!comment) {
Expand All @@ -96,7 +98,7 @@ export class DashboardController {

@Post('comments/deleteMany')
@UseGuards(AuthenticatedGuard)
async deleteComments(@Req() req: Request, @Res() res: Response, @Body() body: { ids: string[] }): Promise<void> {
async deleteComments(@Req() req: Request, @Res() res: Response, @Body() body: { ids: string[] }): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
for (const id of body.ids) {
const comment = await this.commentService.findById(account, id)
Expand All @@ -112,7 +114,7 @@ export class DashboardController {

@Post('spam/delete')
@UseGuards(AuthenticatedGuard)
async deleteSpamComment(@Req() req: Request, @Res() res: Response, @Body() id: Identifiable): Promise<void> {
async deleteSpamComment(@Req() req: Request, @Res() res: Response, @Body() id: Identifiable): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
const comment = await this.commentService.findSpamById(account, id.id)
if (!comment) {
Expand All @@ -127,7 +129,7 @@ export class DashboardController {

@Post('spam/deleteMany')
@UseGuards(AuthenticatedGuard)
async deleteSpamComments(@Req() req: Request, @Res() res: Response, @Body() body: { ids: string[] }): Promise<void> {
async deleteSpamComments(@Req() req: Request, @Res() res: Response, @Body() body: { ids: string[] }): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
for (const id of body.ids) {
const comment = await this.commentService.findSpamById(account, id)
Expand All @@ -143,7 +145,7 @@ export class DashboardController {

@Post('spam/unmark')
@UseGuards(AuthenticatedGuard)
async unmarkSingle(@Req() req: Request, @Res() res: Response, @Body() id: Identifiable): Promise<void> {
async unmarkSingle(@Req() req: Request, @Res() res: Response, @Body() id: Identifiable): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
const comment = await this.commentService.findSpamById(account, id.id)
if (!comment) {
Expand All @@ -156,7 +158,7 @@ export class DashboardController {

@Post('spam/unmarkMany')
@UseGuards(AuthenticatedGuard)
async unmarkMany(@Req() req: Request, @Res() res: Response, @Body() body: { ids: string[] }): Promise<void> {
async unmarkMany(@Req() req: Request, @Res() res: Response, @Body() body: { ids: string[] }): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
for (const id of body.ids) {
const comment = await this.commentService.findSpamById(account, id)
Expand All @@ -172,7 +174,7 @@ export class DashboardController {

@Post('spam/purge')
@UseGuards(AuthenticatedGuard)
async purgeSpam(@Req() req: Request, @Res() res: Response): Promise<void> {
async purgeSpam(@Req() req: Request, @Res() res: Response): Promise<GenericResponse> {
const account = _.get(req, 'user') as Account
await this.commentService.purgeSpam(account)

Expand Down
Loading

0 comments on commit 463eeac

Please sign in to comment.