Skip to content

Commit

Permalink
[4.x] Handle unauthorized response in Inline Publish Form (#8918)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Nov 2, 2023
1 parent 660e4a9 commit d3bb6df
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions resources/js/components/inputs/relationship/InlinePublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,20 @@ export default {
methods: {
getItem() {
this.$axios.get(this.itemUrl).then(response => {
for (const prop in this.componentProps) {
const value = data_get(response.data, this.componentProps[prop]);
this.$set(this.componentPropValues, prop, value);
}
this.loading = false;
});
this.$axios.get(this.itemUrl)
.then(response => {
for (const prop in this.componentProps) {
const value = data_get(response.data, this.componentProps[prop]);
this.$set(this.componentPropValues, prop, value);
}
this.loading = false;
}).catch((error) => {
if (error.response.status === 403) {
this.$toast.error(__('This action is unauthorized.'));
this.close();
}
});
},
close() {
Expand Down

0 comments on commit d3bb6df

Please sign in to comment.