Skip to content

Commit

Permalink
test db
Browse files Browse the repository at this point in the history
  • Loading branch information
AC-devon committed May 12, 2023
1 parent 65f7e21 commit 33ef13e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ npm-debug.log*
.firebase
*-debug.log
.runtimeconfig.json
.vercel
2 changes: 2 additions & 0 deletions api/votes.js → api/db/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ async function run() {
}
}
run().catch(console.dir);

export {client};
20 changes: 20 additions & 0 deletions api/db/votes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { client } from './connect';
export default async function votes(request, response) {
const { endpoint } = request.query;
const { body } = request
// const queryParamDecode = decodeURIComponent(queryParam);
await client.db.collection('votes').insertOne({
item: 'canvas',
qty: 100,
tags: ['cotton'],
size: { h: 28, w: 35.5, uom: 'cm' }
});
try {
const res = await fetch(url, settings, JSON.stringify(body));
const data = await res.json();
return response.status(200).json(data);
} catch (error) {
return response.status(500).json(error);
}

}
28 changes: 14 additions & 14 deletions src/app/pages/vote-what-next/proposals/proposals.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Component, OnInit } from '@angular/core';
import { Proposal } from 'src/app/models';
import { Component, OnInit } from "@angular/core";
import { Proposal } from "src/app/models";


@Component({
selector: 'app-proposals',
templateUrl: './proposals.component.html',
styleUrls: ['./proposals.component.scss'],
selector: "app-proposals",
templateUrl: "./proposals.component.html",
styleUrls: ["./proposals.component.scss"],
})
export class ProposalsComponent implements OnInit {
public searchTerm: string;
public proposals: Proposal[] = [{
uuid:"234534645",
date: new Date(),
category: "integration",
title: 'orca integration',
desc: 'This proposal will - Ratify the Constitution to be used by Marinade DAO - Ratify the Code of Conduct to be used by Marinade DAO - Confirm phase one of the migration to SPL governance, where multisigs and team powers are moved to Realms while MNDE voting stays on Tribeca until phase two.',
ownerPK: 'JPQmr9p2RF3X5TuBXxn6AGcEfcsHp4ehcmzE5Ys7pZD',
title: "orca integration",
desc: "This proposal will - Ratify the Constitution to be used by Marinade DAO - Ratify the Code of Conduct to be used by Marinade DAO - Confirm phase one of the migration to SPL governance, where multisigs and team powers are moved to Realms while MNDE voting stays on Tribeca until phase two.",
ownerPK: "JPQmr9p2RF3X5TuBXxn6AGcEfcsHp4ehcmzE5Ys7pZD",
for: 100,
against: 15,
status: "vote",
Expand All @@ -24,9 +24,9 @@ export class ProposalsComponent implements OnInit {
uuid:"678678768",
date: new Date(),
category: "feature",
title: 'split accounts ',
desc: 'split stake account loreum ipsum',
ownerPK: '81QNHLve6e9N2fYNoLUnf6tfHWV8Uq4qWZkkuZ8sAfU1',
title: "split accounts ",
desc: "split stake account loreum ipsum",
ownerPK: "81QNHLve6e9N2fYNoLUnf6tfHWV8Uq4qWZkkuZ8sAfU1",
for: 128,
against: 35,
status: "pass",
Expand All @@ -35,9 +35,9 @@ export class ProposalsComponent implements OnInit {
uuid:"456456",
date: new Date(),
category: "feature",
title: 'bulk swap ',
desc: 'This proposal will - Ratify the Constitution to be used by Marinade DAO - Ratify the Code of Conduct to be used by Marinade DAO - Confirm phase one of the migration to SPL governance, where multisigs and team powers are moved to Realms while MNDE voting stays on Tribeca until phase two.',
ownerPK: '81QNHLve6e9N2fYNoLUnf6tfHWV8Uq4qWZkkuZ8sAfU1',
title: "bulk swap ",
desc: "This proposal will - Ratify the Constitution to be used by Marinade DAO - Ratify the Code of Conduct to be used by Marinade DAO - Confirm phase one of the migration to SPL governance, where multisigs and team powers are moved to Realms while MNDE voting stays on Tribeca until phase two.",
ownerPK: "81QNHLve6e9N2fYNoLUnf6tfHWV8Uq4qWZkkuZ8sAfU1",
for: 8,
against: 3,
status: "completed",
Expand Down

0 comments on commit 33ef13e

Please sign in to comment.