Skip to content

Commit

Permalink
Improve error handling and reponses
Browse files Browse the repository at this point in the history
  • Loading branch information
dacoaster committed Aug 28, 2023
1 parent 035b7c4 commit 01d713e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/settings/AddonsTab.vue
Expand Up @@ -138,7 +138,6 @@ export default {
},
async handleOpenAIKey() {
let validates = this.$refs.openAIKey.validate();
console.log(this.openAIKey);
if (validates) {
const date = dayjs().format("YYYY-MM-DD HH:mm:ss");
const data = {
Expand All @@ -157,6 +156,7 @@ export default {
);
if (validate) {
this.openAIKey = this.sanitizeOpenAIKey(this.credentials);
this.customErrors = [];
this.$refs.openAIKey.resetValidation();
this.$root.$emit(
"set-snackbar",
Expand Down
4 changes: 4 additions & 0 deletions src/integrations/OpenAIIntegrationHelpers.js
Expand Up @@ -8,6 +8,10 @@ import {

export default {
async enhanceText(credentials, config, field, text) {
if (!credentials?.openai?.accessToken) {
return { error: "You must provide an OpenAI key in Settings > Addons." };
} // TODO - i18n

let returnResponse = {
content: "",
};
Expand Down

0 comments on commit 01d713e

Please sign in to comment.