Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use updated_at as created_at for projects #1841

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/back/models/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export default class ProjectModel extends Model<ProjectAttributes> {

static async migrate(proposals: ProposalProject[]) {
const values = proposals.map(
({ id, title, about, status, created_at }) =>
SQL`(${crypto.randomUUID()}, ${id}, ${title}, ${about}, ${status}, ${new Date(created_at)})`
({ id, title, about, status, updated_at }) =>
SQL`(${crypto.randomUUID()}, ${id}, ${title}, ${about}, ${status}, ${new Date(updated_at)})`
)

const query = SQL`
Expand Down
1 change: 1 addition & 0 deletions src/entities/Proposal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ export type ProposalProject = {
type: ProposalType
about: string
created_at: number
updated_at: number
configuration: {
category: ProposalGrantCategory
tier: string
Expand Down
1 change: 1 addition & 0 deletions src/utils/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function createProposalProject(proposal: ProposalWithProject, vesting?: T
type: proposal.type,
size: proposal.configuration.size || proposal.configuration.funding,
created_at: proposal.created_at.getTime(),
updated_at: proposal.updated_at.getTime(),
configuration: {
category: proposal.configuration.category || proposal.type,
tier: proposal.configuration.tier,
Expand Down