Skip to content

Commit

Permalink
Quix fixes on fk and ts enum use
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjyhy committed Nov 21, 2024
1 parent ea92e72 commit 8511ef8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/migrations/1731486908522-AddPhaseHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class AddPhaseHistory1731486908522 implements MigrationInterface {
public async down(queryRunner: QueryRunner): Promise<void> {
const table = await queryRunner.getTable('phase_history');
if (table) {
const foreignKey = table.foreignKeys.find((fk) => fk.columnNames.indexOf('questionId') !== -1);
const foreignKey = table.foreignKeys.find((fk) => fk.columnNames.indexOf('villageId') !== -1);
if (foreignKey) {
await queryRunner.dropForeignKey('phase_history', foreignKey);
await queryRunner.dropIndex('phase_history', 'IDX_PHASE_HISTORY');
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/manage/settings/SavePhasesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { softDeletePhaseHistory } from 'src/api/phaseHistory/phaseHistory.delete
import { postPhaseHistory } from 'src/api/phaseHistory/phaseHistory.post';
import { useUpdateVillages } from 'src/api/villages/villages.put';
import { Modal } from 'src/components/Modal';
import type { VillagePhase } from 'types/village.type';
import { VillagePhase } from 'types/village.type';

interface SavePhasesModalProps {
villagesToUpdate: { [villageId: number]: VillagePhase };
Expand All @@ -22,7 +22,7 @@ export function SavePhasesModal({ villagesToUpdate, isModalOpen, setIsModalOpen
const promises = [];
for (const key in villagesToUpdate) {
const villageId: number = +key;
const updatedPhase = Math.min(villagesToUpdate[villageId], 3);
const updatedPhase = Math.min(villagesToUpdate[villageId], VillagePhase.IMAGINE);
promises.push(
updateVillages.mutateAsync({
id: villageId,
Expand Down

0 comments on commit 8511ef8

Please sign in to comment.