Skip to content

Commit

Permalink
Default public archive to null
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendPeter committed Jan 29, 2025
1 parent dcb0e2d commit 87b251f
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/Migrations/2025_01_29_admin_upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function up(db: Kysely<any>): Promise<void> {
await db.updateTable('electionDB')
.set({
ballot_source: 'live_election',
public_archive_id: '',
public_archive_id: null,
})
.execute()
}
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/Models/Elections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class ElectionsDB implements IElectionStore {
return await this._postgresClient
.selectFrom(tableName)
.where('head', '=', true)
.where('public_archive_id', '!=', '')
.where('public_archive_id', '!=', null)
.selectAll()
.execute()
}
Expand Down
2 changes: 0 additions & 2 deletions packages/backend/src/OpenApi/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@
"frontend_url",
"head",
"owner_id",
"public_archive_id",
"races",
"settings",
"state",
Expand Down Expand Up @@ -890,7 +889,6 @@
"ballot_source",
"frontend_url",
"owner_id",
"public_archive_id",
"races",
"settings",
"state",
Expand Down
1 change: 0 additions & 1 deletion packages/backend/src/test/database_sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function buildElection(i: string, update_date: string, head: boolean): Election
update_date: update_date,
head: head,
ballot_source: 'live_election',
public_archive_id: '',
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const ViewBallots = () => {
// so we use election instead of precinctFilteredElection
const { election } = useElection()
const { data, isPending, error, makeRequest: fetchBallots } = useGetBallots(election.election_id)

const flags = useFeatureFlags();
useEffect(() => { fetchBallots() }, [])
const [isViewing, setIsViewing] = useState(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const defaultElection: NewElection = {
state: 'draft',
frontend_url: '',
ballot_source: 'live_election',
public_archive_id: '',
races: [],
settings: {
voter_authentication: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const QuickPoll = () => {
owner_id: '0',
is_public: false,
ballot_source: 'live_election',
public_archive_id: '',
races: [
{
title: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/domain_model/Election.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface Election {
update_date: Date | string; // Date this object was last updated
head: boolean;// Head version of this object
ballot_source: 'live_election' | 'prior_election';
public_archive_id: string;
public_archive_id?: string;
}
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
Expand Down

0 comments on commit 87b251f

Please sign in to comment.