Add support for overriding subscriptions when importing.

This commit is contained in:
FireMasterK 2021-08-28 13:27:16 +05:30
parent 08df4866a7
commit f33a51e61f
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -7,6 +7,9 @@
<div class="uk-form-row"> <div class="uk-form-row">
<b>Selected Subscriptions: {{ selectedSubscriptions }}</b> <b>Selected Subscriptions: {{ selectedSubscriptions }}</b>
</div> </div>
<div class="uk-form-row">
<b>Override: <input class="uk-checkbox" v-model="override" type="checkbox"/></b>
</div>
<div class="uk-form-row"> <div class="uk-form-row">
<a <a
class="uk-width-1-1 uk-button uk-button-primary uk-button-large uk-width-auto" class="uk-width-1-1 uk-button uk-button-primary uk-button-large uk-width-auto"
@ -62,6 +65,7 @@ export default {
data() { data() {
return { return {
subscriptions: [], subscriptions: [],
override: false,
}; };
}, },
computed: { computed: {
@ -125,13 +129,19 @@ export default {
}); });
}, },
handleImport() { handleImport() {
this.fetchJson(this.apiUrl() + "/import", null, { this.fetchJson(
method: "POST", this.apiUrl() + "/import",
headers: { {
Authorization: this.getAuthToken(), override: this.override,
}, },
body: JSON.stringify(this.subscriptions), {
}).then(json => { method: "POST",
headers: {
Authorization: this.getAuthToken(),
},
body: JSON.stringify(this.subscriptions),
},
).then(json => {
if (json.message === "ok") window.location = "/feed"; if (json.message === "ok") window.location = "/feed";
}); });
}, },