Cost units can be edited
This commit is contained in:
@@ -4,6 +4,7 @@ export function useAjax() {
|
||||
const loading = ref(false)
|
||||
const error = ref(null)
|
||||
const data = ref(null)
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content')
|
||||
|
||||
async function request(url, options = {}) {
|
||||
loading.value = true
|
||||
@@ -15,6 +16,7 @@ export function useAjax() {
|
||||
method: options.method || "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
'X-CSRF-TOKEN': csrfToken,
|
||||
...(options.headers || {}),
|
||||
},
|
||||
body: options.body ? JSON.stringify(options.body) : null,
|
||||
|
||||
Reference in New Issue
Block a user