Skip to content

Commit

Permalink
Merge pull request #384 from dfpc-coe/delete-video-lease
Browse files Browse the repository at this point in the history
Delete Video Lease
  • Loading branch information
ingalls authored Oct 15, 2024
2 parents a3009a8 + ae8c7f8 commit 75ff9d9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions api/web/src/components/CloudTAK/util/Video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export default defineComponent({
loading: true
}
},
unmounted: function() {
unmounted: async function() {
if (this.player) {
this.player.dispose();
}
await this.deleteLease();
},
mounted: async function() {
await this.requestLease();
Expand All @@ -95,7 +97,21 @@ export default defineComponent({
}
},
methods: {
requestLease: async function() {
deleteLease: async function(): Promise<void> {
if (!this.lease) return;
try {
await std(`/api/video/lease/${this.lease.id}`, {
method: 'DELETE',
});
this.loading = false;
} catch (err) {
this.loading = false;
this.err = err instanceof Error ? err : new Error(String(err));
}
},
requestLease: async function(): Promise<void> {
try {
const { lease, protocols } = await std('/api/video/lease', {
method: 'POST',
Expand Down

0 comments on commit 75ff9d9

Please sign in to comment.