Skip to content

Commit

Permalink
changed colors json, colors still not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiktor-Wojciechowski committed Jul 2, 2024
1 parent eab59af commit 1c667cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
23 changes: 10 additions & 13 deletions resources/data/colors.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"colors": [
"bg-gray-400",
"bg-blue-400",
"bg-red-400",
"bg-green-400",
"bg-yellow-400",
"bg-indigo-400",
"bg-purple-400",
"bg-pink-400"
]
}

[
"bg-gray-400",
"bg-blue-400",
"bg-red-400",
"bg-green-400",
"bg-yellow-400",
"bg-indigo-400",
"bg-purple-400",
"bg-pink-400"
]
14 changes: 10 additions & 4 deletions resources/js/Pages/Repositories.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const colors = ref([])
async function fetchColors() {
const response = await fetch('api/data/colors')
const data = await response.json()
return data.colors
return new Promise((resolve, reject) => {

Check failure on line 13 in resources/js/Pages/Repositories.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Returning an awaited promise is required in this context

Check failure on line 13 in resources/js/Pages/Repositories.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

'reject' is defined but never used
resolve((data))
})
}
const logsStore = useLogsStore()
Expand Down Expand Up @@ -117,10 +119,14 @@ async function parseLogs(){
const data = Papa.parse(logs.value)
const parsedData = data.data
colors.value = await fetchColors()
fetchColors().then((response)=>{

Check failure on line 122 in resources/js/Pages/Repositories.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Expected catch() or return

Check failure on line 122 in resources/js/Pages/Repositories.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

Each then() should return a value or throw
colors.value = response
console.log(colors.value)
var parsed = parsedData.slice(1,-1).map((line) => parseLineToLog(line))
tables.value.logs.items = parsed
})
var parsed = parsedData.slice(1,-1).map((line) => parseLineToLog(line))
tables.value.logs.items = parsed
}
</script>
Expand Down

0 comments on commit 1c667cf

Please sign in to comment.