Skip to content

Commit

Permalink
more update
Browse files Browse the repository at this point in the history
  • Loading branch information
tttp committed Aug 2, 2023
1 parent e625300 commit cc7be15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# dependencies
/node_modules
/lib

.eslintcache
/.pnp
.pnp.js

Expand Down
14 changes: 11 additions & 3 deletions bin/campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ query getCampaign ($name:String!){
campaign (name:$name) {
id,
title,name,config,
org {name,title}
org {name,title},externalId
}
}`;

Expand All @@ -68,8 +68,8 @@ const readCampaign = (name) => {
const pushCampaign = async (name) => {
const campaign = read("campaign/" + name);
const query = `
mutation updateCampaign($orgName: String!, $name: String!, $config: Json!) {
upsertCampaign(orgName: $orgName, input: {
mutation updateCampaign($orgName: String!, $name: String!, $config: Json!, $externalId: Int) {
upsertCampaign(orgName: $orgName, input: { externalId: $externalId,
name: $name, config: $config, actionPages: []
}) {
id
Expand All @@ -84,6 +84,13 @@ mutation updateCampaign($orgName: String!, $name: String!, $config: Json!) {
let data;

try {
console.log({
orgName: campaign.org.name,
name: campaign.name,
title: campaign.title,
// externalId: campaign.externalId,
config: JSON.stringify(campaign.config),
});
const res = await crossFetch(API_URL, {
method: "POST",
body: JSON.stringify({
Expand All @@ -92,6 +99,7 @@ mutation updateCampaign($orgName: String!, $name: String!, $config: Json!) {
orgName: campaign.org.name,
name: campaign.name,
title: campaign.title,
// externalId: campaign.externalId,
config: JSON.stringify(campaign.config),
},
operationName: "updateCampaign",
Expand Down
1 change: 0 additions & 1 deletion bin/org.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ query GetOrg($name: String!) {
}
`;

console.log(query);
const data = await api(query, { name }, "GetOrg");
if (!data.org) throw new Error("can't find org " + name);

Expand Down

0 comments on commit cc7be15

Please sign in to comment.