feat: Add draft column to connections
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Knex } from 'knex';
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
return knex.schema.table('connections', (table) => {
|
||||
table.boolean('draft').defaultTo(true);
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
return knex.schema.table('connections', (table) => {
|
||||
table.dropColumn('draft');
|
||||
});
|
||||
}
|
@@ -32,6 +32,7 @@ const verifyConnection = async (
|
||||
...verifiedCredentials,
|
||||
},
|
||||
verified: true,
|
||||
draft: false,
|
||||
});
|
||||
|
||||
return connection;
|
||||
|
@@ -13,6 +13,7 @@ const getApp = async (_parent: unknown, params: Params, context: Context) => {
|
||||
.$relatedQuery('connections')
|
||||
.where({
|
||||
key: params.key,
|
||||
draft: false,
|
||||
})
|
||||
.orderBy('created_at', 'desc');
|
||||
|
||||
|
@@ -14,6 +14,7 @@ class Connection extends Base {
|
||||
formattedData?: IJSONObject;
|
||||
userId!: string;
|
||||
verified = false;
|
||||
draft: boolean;
|
||||
count?: number;
|
||||
|
||||
static tableName = 'connections';
|
||||
@@ -29,6 +30,7 @@ class Connection extends Base {
|
||||
formattedData: { type: 'object' },
|
||||
userId: { type: 'string', format: 'uuid' },
|
||||
verified: { type: 'boolean' },
|
||||
draft: { type: 'boolean' },
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user