Skip to content

Commit

Permalink
adding country
Browse files Browse the repository at this point in the history
  • Loading branch information
maudhelen committed Oct 14, 2023
1 parent b693458 commit 8f8a8c7
Showing 1 changed file with 59 additions and 56 deletions.
115 changes: 59 additions & 56 deletions src/components/AppAccounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<th scope="col">Account Name</th>
<th scope="col">Account Number</th>
<th scope="col">Account Balance</th>
<th scope="col">Account Country</th>
<th scope="col">Account Currency</th>
<th scope="col">Account Status</th>
<th scope="col">Country</th>
<th scope="col">Actions</th>
</tr>
</thead>
Expand All @@ -37,7 +37,6 @@
<td>{{ account.name }}</td>
<td>{{ account.account_number }}</td>
<td>{{ account.balance }}</td>
<td>{{ account.country }}</td>
<td>{{ account.currency }}</td>
<td>
<span
Expand All @@ -49,6 +48,7 @@
account.status
}}</span>
</td>
<td>{{ account.country }}</td>
<td>
<div class="btn-group" role="group">
<button
Expand Down Expand Up @@ -76,61 +76,62 @@
</footer>
</div>
</div>
<b-modal
ref="addAccountModal"
id="account-modal"
title="Create a new account"
hide-backdrop
hide-footer
>
<b-form @submit="onSubmit" class="w-100">
<b-form-group
id="form-name-group"
label="Account Name:"
label-for="form-name-input"
>
<b-form-input
id="form-name-input"
type="text"
v-model="createAccountForm.name"
placeholder="Account Name"
required
>
</b-form-input>
</b-form-group>
<b-form-group
id="form-currency-group"
label="Currency:"
label-for="form-currency-input"
>
<b-form-input
id="form-currency-input"
type="text"
v-model="createAccountForm.currency"
placeholder="$ or €"
required
>
</b-form-input>
</b-form-group>
<b-form-group
id="form-country-group"
label="Country:"
label-for="form-country-input"
>
<b-form-input
id="form-country-input"
type="text"
v-model="createAccountForm.country"
placeholder="Country"
required
<b-modal
ref="addAccountModal"
id="account-modal"
title="Create a new account"
hide-backdrop
hide-footer
>
</b-form-input>
</b-form-group>
<b-form @submit="onSubmit" class="w-100">
<b-form-group
id="form-name-group"
label="Account Name:"
label-for="form-name-input"
>
<b-form-input
id="form-name-input"
type="text"
v-model="createAccountForm.name"
placeholder="Account Name"
required
>
</b-form-input>
</b-form-group>

<b-form-group
id="form-currency-group"
label="Currency:"
label-for="form-currency-input"
>
<b-form-input
id="form-currency-input"
type="text"
v-model="createAccountForm.currency"
placeholder="$ or €"
required
>
</b-form-input>
</b-form-group>

<b-button type="submit" variant="outline-info">Submit</b-button>
</b-form>
</b-modal>
<b-form-group
id="form-country-group"
label="Country:"
label-for="form-country-input"
>
<b-form-input
id="form-country-input"
type="text"
v-model="createAccountForm.country"
placeholder="Spain"
required
>
</b-form-input>
</b-form-group>

<b-button type="submit" variant="outline-info">Submit</b-button>
</b-form>
</b-modal>
<!-- End of Modal for Create Account-->
<!-- Start of Modal for Edit Account-->
<b-modal
Expand Down Expand Up @@ -231,7 +232,7 @@ export default {
.then((response) => {
this.RESTgetAccounts();
// For message alert
this.message = "Account Updated succesfully!";
this.message = "Account Updated successfully!";
// To actually show the message
this.showMessage = true;
// To hide the message after 3 seconds
Expand Down Expand Up @@ -275,6 +276,7 @@ export default {
initForm() {
this.createAccountForm.name = "";
this.createAccountForm.currency = "";
this.createAccountForm.country = "";
this.editAccountForm.id = "";
this.editAccountForm.name = "";
},
Expand All @@ -286,6 +288,7 @@ export default {
const payload = {
name: this.createAccountForm.name,
currency: this.createAccountForm.currency,
country: this.createAccountForm.country,
};
this.RESTcreateAccount(payload);
this.initForm();
Expand Down Expand Up @@ -320,4 +323,4 @@ export default {
this.RESTgetAccounts();
},
};
</script>
</script>

0 comments on commit 8f8a8c7

Please sign in to comment.