Skip to content

Commit

Permalink
🛠️: refactor Webhook to composition API and ts
Browse files Browse the repository at this point in the history
  • Loading branch information
itisAliRH committed Feb 8, 2024
1 parent 752e6b2 commit 02f096e
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions client/src/components/Common/Webhook.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";
import Webhooks from "@/utils/webhooks";
interface Props {
type: string;
toolId?: string;
}
const props = withDefaults(defineProps<Props>(), {
toolId: undefined,
});
const webhook = ref(null);
onMounted(() => {
new Webhooks.WebhookView({
webhook,
type: props.type,
toolId: props.toolId,
});
});
</script>

<template>
<div id="webhook-view" ref="webhook" />
</template>
<script>
import Webhooks from "utils/webhooks";
export default {
props: {
type: {
type: String,
required: true,
},
toolId: {
type: String,
default: null,
},
},
mounted() {
const el = this.$refs["webhook"];
new Webhooks.WebhookView({
el,
type: this.type,
toolId: this.toolId,
});
},
};
</script>

0 comments on commit 02f096e

Please sign in to comment.