This commit is contained in:
@@ -12,6 +12,7 @@ const wrapper = ref(null);
|
||||
|
||||
const props = defineProps(['data']);
|
||||
const data = props.data;
|
||||
const loading = ref(false);
|
||||
|
||||
let id = data.id;
|
||||
|
||||
@@ -29,11 +30,13 @@ const colorPicker = ref(null);
|
||||
function NewCampaign(){
|
||||
const color = colorPicker.value.GetColor();
|
||||
console.log(color);
|
||||
loading.value = true;
|
||||
Server().post('/campaign/create', {
|
||||
name: campaignName.value,
|
||||
description: campaignDescription.value,
|
||||
color: colorPicker.value.GetColor(),
|
||||
}).then((response) => {
|
||||
loading.value = false;
|
||||
console.log(response.data);
|
||||
DisplayToast('green', $t('campaigns.create.success'), 3000);
|
||||
ClearWindow({id});
|
||||
@@ -63,7 +66,12 @@ function NewCampaign(){
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn-primary sound-click">
|
||||
{{ $t("general.create") }}
|
||||
<span v-if="loading">
|
||||
<Spinner />
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ $t("general.create") }}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user