mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 20:22:07 +00:00
Include correct URI for transaction autocomplete [skip ci]
This commit is contained in:
@@ -48,12 +48,9 @@ class ApiDemoUser
|
||||
if (null === $user) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
/** @var UserRepositoryInterface $repository */
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
|
||||
if ($repository->hasRole($user, 'demo')) {
|
||||
if ($user->hasRole('demo')) {
|
||||
return response('', 403);
|
||||
|
||||
}
|
||||
|
||||
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-focus=true
|
||||
v-on:input="selectedItem"
|
||||
:async-src="descriptionAutoCompleteURI"
|
||||
:async-function="aSyncFunction"
|
||||
v-model="name"
|
||||
:target="target"
|
||||
item-key="description"
|
||||
@@ -62,7 +62,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
props: ['error', 'value', 'index'],
|
||||
name: "TransactionDescription",
|
||||
mounted() {
|
||||
@@ -70,8 +70,7 @@
|
||||
this.descriptionAutoCompleteURI = document.getElementsByTagName('base')[0].href + "api/v1/autocomplete/transactions?query=";
|
||||
this.$refs.descr.focus();
|
||||
},
|
||||
components: {
|
||||
},
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
descriptionAutoCompleteURI: null,
|
||||
@@ -81,8 +80,17 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
search: function(input) {
|
||||
return ['ab','cd'];
|
||||
aSyncFunction: function (query, done) {
|
||||
axios.get(this.descriptionAutoCompleteURI + query)
|
||||
.then(res => {
|
||||
done(res.data);
|
||||
})
|
||||
.catch(err => {
|
||||
// any error handler
|
||||
})
|
||||
},
|
||||
search: function (input) {
|
||||
return ['ab', 'cd'];
|
||||
},
|
||||
hasError: function () {
|
||||
return this.error.length > 0;
|
||||
@@ -116,7 +124,7 @@
|
||||
this.$emit('input', this.$refs.descr.value);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
Reference in New Issue
Block a user