Skip to content

Commit

Permalink
add endpoint option in feedback component used in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
yujonglee committed Aug 21, 2024
1 parent 124dcd9 commit ced1c82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/apps/docs/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ onMounted(() => {
<div class="flex justify-center items-center" v-if="loaded">
<canary-styles framework="vitepress">
<canary-feedback-page
endpoint="https://cloud.getcanary.dev"
key="pk_3nU5ydAaTWcoqbsuUNYoyqHa"
></canary-feedback-page>
</canary-styles>
Expand Down
10 changes: 9 additions & 1 deletion js/packages/web/src/components/canary-feedback-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ export class CanaryFeedbackPage extends LitElement {
completeText = "Got it, Thank you!";

@property({ type: String })
endpoint = "";
endpoint = "https://cloud.getcanary.dev";

@property({ type: String })
key = "";

connectedCallback(): void {
super.connectedCallback();

if (this.key === "") {
throw new Error("key is required");
}
}

private _task = new Task(this, {
task: async ([url, score]: [string, number], { signal }) => {
const response = await fetch(`${this.endpoint}/api/v1/feedback/page`, {
Expand Down

0 comments on commit ced1c82

Please sign in to comment.