mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Include correct URI for transaction autocomplete [skip ci]
This commit is contained in:
@@ -48,12 +48,9 @@ class ApiDemoUser
|
|||||||
if (null === $user) {
|
if (null === $user) {
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
if ($user->hasRole('demo')) {
|
||||||
/** @var UserRepositoryInterface $repository */
|
|
||||||
$repository = app(UserRepositoryInterface::class);
|
|
||||||
|
|
||||||
if ($repository->hasRole($user, 'demo')) {
|
|
||||||
return response('', 403);
|
return response('', 403);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
2
public/v1/js/create_transaction.js
vendored
2
public/v1/js/create_transaction.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/edit_transaction.js
vendored
2
public/v1/js/edit_transaction.js
vendored
File diff suppressed because one or more lines are too long
@@ -49,7 +49,7 @@
|
|||||||
:open-on-empty=true
|
:open-on-empty=true
|
||||||
:open-on-focus=true
|
:open-on-focus=true
|
||||||
v-on:input="selectedItem"
|
v-on:input="selectedItem"
|
||||||
:async-src="descriptionAutoCompleteURI"
|
:async-function="aSyncFunction"
|
||||||
v-model="name"
|
v-model="name"
|
||||||
:target="target"
|
:target="target"
|
||||||
item-key="description"
|
item-key="description"
|
||||||
@@ -70,8 +70,7 @@
|
|||||||
this.descriptionAutoCompleteURI = document.getElementsByTagName('base')[0].href + "api/v1/autocomplete/transactions?query=";
|
this.descriptionAutoCompleteURI = document.getElementsByTagName('base')[0].href + "api/v1/autocomplete/transactions?query=";
|
||||||
this.$refs.descr.focus();
|
this.$refs.descr.focus();
|
||||||
},
|
},
|
||||||
components: {
|
components: {},
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
descriptionAutoCompleteURI: null,
|
descriptionAutoCompleteURI: null,
|
||||||
@@ -81,6 +80,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
aSyncFunction: function (query, done) {
|
||||||
|
axios.get(this.descriptionAutoCompleteURI + query)
|
||||||
|
.then(res => {
|
||||||
|
done(res.data);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
// any error handler
|
||||||
|
})
|
||||||
|
},
|
||||||
search: function (input) {
|
search: function (input) {
|
||||||
return ['ab', 'cd'];
|
return ['ab', 'cd'];
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user