fixed entityRef bug and added functionality to add community link
Signed-off-by: Lykke Axlin <lykkeaxlin@hotmail.com> Co-authored-by: klaraab <klarabroman@live.se>
This commit is contained in:
@@ -19,15 +19,18 @@ exports.up = async function setUpTables(knex) {
|
||||
table.comment('The table of Bazaar metadata');
|
||||
table.text('name').notNullable().comment('The name of the entity');
|
||||
table.text('entity_ref').notNullable().comment('The ref of the entity');
|
||||
table
|
||||
.text('community')
|
||||
.comment('Link to where the community can discuss ideas');
|
||||
table
|
||||
.text('announcement')
|
||||
.notNullable()
|
||||
.comment('The announcement of the bazaar project');
|
||||
.comment('The announcement of the Bazaar project');
|
||||
table
|
||||
.text('status')
|
||||
.defaultTo('proposed')
|
||||
.notNullable()
|
||||
.comment('The status of the bazaar project');
|
||||
.comment('The status of the Bazaar project');
|
||||
table
|
||||
.dateTime('updated_at')
|
||||
.defaultTo(knex.fn.now())
|
||||
|
||||
@@ -138,12 +138,13 @@ export async function createRouter(
|
||||
|
||||
router.put('/metadata', async (request, response) => {
|
||||
const entityRef = request.headers.entity_ref;
|
||||
const { name, announcement, status } = request.body;
|
||||
const { name, announcement, status, community } = request.body;
|
||||
|
||||
const count = await db?.('public.metadata')
|
||||
.where({ entity_ref: entityRef })
|
||||
.update({
|
||||
announcement: announcement,
|
||||
community: community,
|
||||
status: status,
|
||||
});
|
||||
|
||||
@@ -154,6 +155,7 @@ export async function createRouter(
|
||||
?.insert({
|
||||
name: name,
|
||||
entity_ref: entityRef,
|
||||
community: community,
|
||||
announcement: announcement,
|
||||
status: status,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user