Skip to content

Commit 1f9331f

Browse files
committed
filter propertyId prop by clientId
1 parent e93f176 commit 1f9331f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

components/jobber/actions/create-quote/create-quote.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import jobber from "../../jobber.app.mjs";
33
export default {
44
key: "jobber-create-quote",
55
name: "Create Quote",
6-
description: "Generates a new quote for the client's first property in Jobber. [See the documentation](https://developer.getjobber.com/docs/)",
6+
description: "Generates a new quote for a client's property in Jobber. [See the documentation](https://developer.getjobber.com/docs/)",
77
version: "0.0.2",
88
type: "action",
99
props: {
@@ -23,6 +23,9 @@ export default {
2323
propDefinition: [
2424
jobber,
2525
"propertyId",
26+
(c) => ({
27+
clientId: c.clientId,
28+
}),
2629
],
2730
},
2831
message: {

components/jobber/jobber.app.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ export default {
3535
type: "string",
3636
label: "Property ID",
3737
description: "The ID of a property",
38-
async options() {
38+
async options({ clientId }) {
39+
const filter = clientId
40+
? `(filter: { clientId: "${clientId}" })`
41+
: "";
3942
const { data: { properties: { nodes } } } = await this.post({
4043
data: {
4144
query: `query GetProperties {
42-
properties {
45+
properties${filter} {
4346
nodes {
4447
id
4548
address {

0 commit comments

Comments
 (0)