Skip to content

Commit

Permalink
[fix] Puppeteer Docker compatibility
Browse files Browse the repository at this point in the history
[fix] remove Activity Log of Election Voter for now

Signed-off-by: South Drifter <shiy2008@gmail.com>
  • Loading branch information
TechQuery committed Jan 20, 2025
1 parent fc1886a commit aa692b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ghcr.io/puppeteer/puppeteer:latest AS base
USER root
RUN apt-get update && \
apt-get install curl -y --no-install-recommends
RUN mv ~/.cache/puppeteer/chrome /opt/chromium
RUN mv /home/pptruser/.cache/puppeteer/chrome /opt/chromium
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down
5 changes: 1 addition & 4 deletions src/controller/Election.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { makeSHA } from 'web-utility';

import { dataSource, User, Voter, VoteTicket } from '../model';
import { lark, MemberBiDataTable } from '../utility';
import { ActivityLogController } from './ActivityLog';

@JsonController('/election')
export class ElectionController {
Expand Down Expand Up @@ -44,9 +43,7 @@ export class ElectionController {
throw new ForbiddenError(
`${nickName} isn't a formal member who has the right to vote in ${electionName} election`
);
const saved = await this.voterStore.save({ electionName, createdBy });

await ActivityLogController.logCreate(createdBy, 'Voter', saved.id);
await this.voterStore.save({ electionName, createdBy });

const meta = [
nickName,
Expand Down
3 changes: 1 addition & 2 deletions src/model/ActivityLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ import { Column, Entity, ViewColumn, ViewEntity } from 'typeorm';
import { Base, BaseFilter, InputData, ListChunk } from './Base';
import { CheckEvent } from './CheckEvent';
import { User, UserBase } from './User';
import { Voter } from './Election';

export enum Operation {
Create = 'create',
Update = 'update',
Delete = 'delete'
}

export const LogableTable = { User, CheckEvent, Voter };
export const LogableTable = { User, CheckEvent };

const LogableTableEnum = Object.fromEntries(
Object.entries(LogableTable).map(([key]) => [key, key])
Expand Down

0 comments on commit aa692b4

Please sign in to comment.