mirror of
https://github.com/ershisan99/vacancies-trends-front.git
synced 2025-12-16 12:34:06 +00:00
initial commit
This commit is contained in:
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,11 +1,14 @@
|
||||
import { Vacancies, VacancyData } from '~/services/vacancies/vacancies.types'
|
||||
|
||||
export class VacanciesService {
|
||||
baseUrl = 'https://vacancies-trends-api.onrender.com'
|
||||
|
||||
async getAll(): Promise<Vacancies> {
|
||||
return await fetch('http://localhost:4321/vacancies').then(res => res.json())
|
||||
return await fetch(`${this.baseUrl}/vacancies`).then(res => res.json())
|
||||
}
|
||||
|
||||
async getAggregateByCreatedAt(): Promise<VacancyData> {
|
||||
return await fetch('http://localhost:4321/vacancies/aggregated')
|
||||
return await fetch(`${this.baseUrl}/vacancies/aggregated`)
|
||||
.then(res => res.json())
|
||||
.then(this.formatDateOnData)
|
||||
}
|
||||
@@ -14,7 +17,7 @@ export class VacanciesService {
|
||||
return data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
date: new Date(item.date).toLocaleTimeString('ru'),
|
||||
date: new Date(item.date).toLocaleDateString('ru'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user