2114 timebox make sure the zapier integrations supports custom objects (#3091)
* Fix build command * Add hidden trigger to fetch object names * Remove useless actions * Rename createObject to createRecord
This commit is contained in:
22
packages/twenty-zapier/src/triggers/find_objects.ts
Normal file
22
packages/twenty-zapier/src/triggers/find_objects.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Bundle, ZObject } from "zapier-platform-core";
|
||||
import { requestSchema } from "../utils/requestDb";
|
||||
|
||||
const objectListRequest = async (z: ZObject, bundle: Bundle) => {
|
||||
const schema = await requestSchema(z, bundle)
|
||||
return Object.keys(schema.components.schemas).map((schema)=> {
|
||||
return {id: schema, nameSingular: schema}
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
display: {
|
||||
description: 'Find objects',
|
||||
label: 'Find objects',
|
||||
hidden: true,
|
||||
},
|
||||
key: 'find_objects',
|
||||
noun: 'Object',
|
||||
operation: {
|
||||
perform: objectListRequest,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user