Fixed team page
This commit is contained in:
parent
d44d106b85
commit
fff0025719
5 changed files with 1099 additions and 21 deletions
|
|
@ -6,7 +6,7 @@ const apiClient = axios.create({
|
|||
timeout: 10000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Origin': 'localhost:8080'
|
||||
//'Origin': 'localhost:8080'
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export const teamService = {
|
|||
// Получить всех членов команды
|
||||
async getTeamMembers() {
|
||||
try {
|
||||
const response = await apiClient.get('/team');
|
||||
const response = await apiClient.get('/members/');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching team members:', error);
|
||||
|
|
@ -27,9 +27,7 @@ export const teamService = {
|
|||
// Получить случайных членов команды для карусели
|
||||
async getRandomMembers(limit = 4) {
|
||||
try {
|
||||
const response = await apiClient.get('/team/random', {
|
||||
params: { limit }
|
||||
});
|
||||
const response = await apiClient.get('/members/');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching random members:', error);
|
||||
|
|
@ -107,4 +105,4 @@ function getMockTeamMembers() {
|
|||
motto: "Идеального кода не существует, но к нему нужно стремиться"
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,10 +5,10 @@ export const teamService = {
|
|||
try {
|
||||
const queryParams = new URLSearchParams();
|
||||
|
||||
if (params.limit) queryParams.append('limit', params.limit);
|
||||
if (params.page) queryParams.append('page', params.page);
|
||||
// if (params.limit) queryParams.append('limit', params.limit);
|
||||
// if (params.page) queryParams.append('page', params.page);
|
||||
|
||||
const url = `/team?${queryParams.toString()}`;
|
||||
const url = `/members`;
|
||||
return await api.get(url);
|
||||
} catch (error) {
|
||||
console.error('Error fetching team:', error);
|
||||
|
|
@ -18,10 +18,10 @@ export const teamService = {
|
|||
|
||||
getTeamMember: async (id) => {
|
||||
try {
|
||||
return await api.get(`/team?id=${id}`);
|
||||
return await api.get(`/team/${id}`);
|
||||
} catch (error) {
|
||||
console.error('Error fetching team member:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,5 +2,14 @@ import { sveltekit } from '@sveltejs/kit/vite';
|
|||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()]
|
||||
plugins: [sveltekit()],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue