-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix more merge conflicts and continue cleaning up integrations frontend
- Loading branch information
1 parent
bacf9f2
commit d410b42
Showing
8 changed files
with
95 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import SecurityClient from "~/utilities/SecurityClient"; | ||
|
||
interface BotKey { | ||
encryptedKey: string; | ||
nonce: string; | ||
} | ||
|
||
interface Props { | ||
botId: string; | ||
isActive: Boolean; | ||
botKey: BotKey; | ||
} | ||
|
||
/** | ||
* This function sets the active status of a bot and shares a copy of | ||
* the project key (encrypted under the bot's public key) with the | ||
* project's bot | ||
* @param {Object} obj | ||
* @param {String} obj.botId | ||
* @param {String} obj.isActive | ||
* @param {Object} obj.botKey | ||
* @returns | ||
*/ | ||
const setBotActiveStatus = async ({ botId, isActive, botKey }: Props) => { | ||
return SecurityClient.fetchCall( | ||
"/api/v1/bot/" + botId + "/active", | ||
{ | ||
method: "PATCH", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
isActive, | ||
botKey | ||
}) | ||
} | ||
).then(async (res) => { | ||
if (res && res.status == 200) { | ||
return await res.json(); | ||
} else { | ||
console.log("Failed to get bot for project"); | ||
} | ||
}); | ||
}; | ||
|
||
export default setBotActiveStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters