Skip to content

Commit b6b78e5

Browse files
authored
fix: fix quick facts not being able to be saved (#6912)
1 parent 2cb7508 commit b6b78e5

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

app/Domains/Contact/ManageQuickFacts/Web/ViewHelpers/ContactModuleQuickFactViewHelper.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ public static function data(Contact $contact, VaultQuickFactsTemplate $template)
2828
],
2929
],
3030
'quick_facts' => $quickFacts,
31-
'url' => [
32-
'store' => route('contact.quick_fact.store', [
33-
'vault' => $contact->vault_id,
34-
'contact' => $contact->id,
35-
'template' => $template->id,
36-
]),
37-
],
3831
];
3932
}
4033

resources/js/Shared/Modules/QuickFacts.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const createQuickFactModalShown = ref(false);
2222
const openState = ref(props.data.show_quick_facts);
2323
const localQuickFacts = ref(props.data.quick_facts.quick_facts);
2424
const localTemplate = ref(props.data.quick_facts.template);
25-
const localUrl = ref(props.data.url);
2625
const contentField = ref(null);
2726
const editedQuickFactId = ref(null);
2827
@@ -48,11 +47,10 @@ const showEditQuickFactModal = (quickFact) => {
4847
4948
const get = (template) => {
5049
loading.value = true;
51-
localTemplate.value = template;
5250
5351
axios.get(template.url.show).then((response) => {
52+
localTemplate.value = response.data.data.template;
5453
localQuickFacts.value = response.data.data.quick_facts;
55-
localUrl.value = response.data.data.url;
5654
loading.value = false;
5755
});
5856
};
@@ -61,7 +59,7 @@ const store = () => {
6159
loadingState.value = 'loading';
6260
6361
axios
64-
.post(localUrl.value.store, form)
62+
.post(localTemplate.value.url.store, form)
6563
.then((response) => {
6664
loadingState.value = '';
6765
createQuickFactModalShown.value = false;

tests/Unit/Domains/Contact/ManageQuickFacts/Web/ViewHelpers/ContactModuleQuickFactViewHelperTest.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,12 @@ public function it_gets_the_data_needed_for_the_view(): void
2222
$array = ContactModuleQuickFactViewHelper::data($contact, $template);
2323

2424
$this->assertEquals(
25-
3,
25+
2,
2626
count($array)
2727
);
2828

2929
$this->assertArrayHasKey('template', $array);
3030
$this->assertArrayHasKey('quick_facts', $array);
31-
$this->assertArrayHasKey('url', $array);
32-
33-
$this->assertEquals(
34-
[
35-
'store' => env('APP_URL').'/vaults/'.$contact->vault->id.'/contacts/'.$contact->id.'/quickFacts/'.$template->id,
36-
],
37-
$array['url']
38-
);
3931
}
4032

4133
/** @test */

0 commit comments

Comments
 (0)