chore: Remove displayName field from credentials
This commit is contained in:
@@ -18,18 +18,6 @@
|
|||||||
"docUrl": "https://automatisch.io/docs/twitter#oauth-redirect-url",
|
"docUrl": "https://automatisch.io/docs/twitter#oauth-redirect-url",
|
||||||
"clickToCopy": true
|
"clickToCopy": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "displayName",
|
|
||||||
"label": "Name",
|
|
||||||
"type": "string",
|
|
||||||
"required": true,
|
|
||||||
"readOnly": false,
|
|
||||||
"value": null,
|
|
||||||
"placeholder": null,
|
|
||||||
"description": "It's the value you can remember later on while changing connection settings.",
|
|
||||||
"docUrl": "https://automatisch.io/docs/twitter#display-name",
|
|
||||||
"clickToCopy": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "consumerKey",
|
"key": "consumerKey",
|
||||||
"label": "Consumer Key",
|
"label": "Consumer Key",
|
||||||
@@ -61,10 +49,6 @@
|
|||||||
"type": "mutation",
|
"type": "mutation",
|
||||||
"name": "createCredential",
|
"name": "createCredential",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
|
||||||
"name": "displayName",
|
|
||||||
"value": "{fields.displayName}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "key",
|
"name": "key",
|
||||||
"value": "{key}"
|
"value": "{key}"
|
||||||
|
@@ -0,0 +1,13 @@
|
|||||||
|
import { Knex } from "knex";
|
||||||
|
|
||||||
|
export async function up(knex: Knex): Promise<void> {
|
||||||
|
return knex.schema.table('credentials', (table) => {
|
||||||
|
table.dropColumn('display_name');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(knex: Knex): Promise<void> {
|
||||||
|
return knex.schema.table('credentials', (table) => {
|
||||||
|
table.string('display_name');
|
||||||
|
});
|
||||||
|
}
|
@@ -6,12 +6,10 @@ import RequestWithCurrentUser from '../../types/express/request-with-current-use
|
|||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
key: string,
|
key: string,
|
||||||
displayName: string,
|
|
||||||
data: object
|
data: object
|
||||||
}
|
}
|
||||||
const createCredentialResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
const createCredentialResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
||||||
const credential = await Credential.query().insert({
|
const credential = await Credential.query().insert({
|
||||||
displayName: params.displayName,
|
|
||||||
key: params.key,
|
key: params.key,
|
||||||
data: params.data,
|
data: params.data,
|
||||||
userId: req.currentUser.id
|
userId: req.currentUser.id
|
||||||
@@ -24,7 +22,6 @@ const createCredential = {
|
|||||||
type: credentialType,
|
type: credentialType,
|
||||||
args: {
|
args: {
|
||||||
key: { type: GraphQLNonNull(GraphQLString) },
|
key: { type: GraphQLNonNull(GraphQLString) },
|
||||||
displayName: { type: GraphQLNonNull(GraphQLString) },
|
|
||||||
data: { type: GraphQLNonNull(twitterCredentialInputType) }
|
data: { type: GraphQLNonNull(twitterCredentialInputType) }
|
||||||
},
|
},
|
||||||
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => createCredentialResolver(params, req)
|
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => createCredentialResolver(params, req)
|
||||||
|
@@ -6,7 +6,6 @@ const credentialType = new GraphQLObjectType({
|
|||||||
fields: {
|
fields: {
|
||||||
id: { type: GraphQLString },
|
id: { type: GraphQLString },
|
||||||
key: { type: GraphQLString },
|
key: { type: GraphQLString },
|
||||||
displayName: { type: GraphQLString },
|
|
||||||
data: { type: twitterCredentialType },
|
data: { type: twitterCredentialType },
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@@ -3,7 +3,6 @@ import User from './user'
|
|||||||
|
|
||||||
class Credential extends Base {
|
class Credential extends Base {
|
||||||
id!: number
|
id!: number
|
||||||
displayName!: string
|
|
||||||
key!: string
|
key!: string
|
||||||
data!: string
|
data!: string
|
||||||
userId!: number
|
userId!: number
|
||||||
@@ -12,11 +11,10 @@ class Credential extends Base {
|
|||||||
|
|
||||||
static jsonSchema = {
|
static jsonSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['displayName', 'key', 'data', 'userId'],
|
required: ['key', 'data', 'userId'],
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
id: { type: 'integer' },
|
id: { type: 'integer' },
|
||||||
displayName: { type: 'string', minLength: 1, maxLength: 255 },
|
|
||||||
key: { type: 'string', minLength: 1, maxLength: 255 },
|
key: { type: 'string', minLength: 1, maxLength: 255 },
|
||||||
data: { type: 'object' },
|
data: { type: 'object' },
|
||||||
userId: { type: 'integer' },
|
userId: { type: 'integer' },
|
||||||
|
Reference in New Issue
Block a user