-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced use axios with use query on GeneralIntoStep container #3134
base: develop
Are you sure you want to change the base?
Changes from all commits
1d38c10
385ee68
e107721
65dddc2
196a4f4
252ea7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,8 +1,10 @@ | ||||||
import { AxiosResponse } from 'axios' | ||||||
import { URLs } from '~/constants/request' | ||||||
import { axiosClient } from '~/plugins/axiosClient' | ||||||
import { Course, CourseForm, GetCoursesParams } from '~/types' | ||||||
import { Course, CourseForm, GetCoursesParams, ItemsWithCount } from '~/types' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
import { createUrlPath } from '~/utils/helper-functions' | ||||||
import { getFullUrl } from '~/utils/get-full-url' | ||||||
import { baseService } from './base-service' | ||||||
|
||||||
export interface Resource { | ||||||
_id: string | ||||||
|
@@ -23,6 +25,16 @@ export interface ResourceData { | |||||
export const CourseService = { | ||||||
getCourses: async (params?: GetCoursesParams): Promise<AxiosResponse> => | ||||||
await axiosClient.get(URLs.courses.get, { params }), | ||||||
|
||||||
getCoursesWithBaseService: (params?: GetCoursesParams) => { | ||||||
return baseService.request<ItemsWithCount<Course>>({ | ||||||
method: 'GET', | ||||||
url: getFullUrl({ | ||||||
pathname: URLs.courses.get, | ||||||
searchParameters: params | ||||||
}) | ||||||
}) | ||||||
}, | ||||||
addCourse: async (data?: CourseForm): Promise<AxiosResponse> => | ||||||
await axiosClient.post(URLs.courses.create, data), | ||||||
getCourse: async (id?: string): Promise<AxiosResponse<Course>> => | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,6 +2,8 @@ import { AxiosResponse } from 'axios' | |||||
import { axiosClient } from '~/plugins/axiosClient' | ||||||
import { URLs } from '~/constants/request' | ||||||
import { createUrlPath } from '~/utils/helper-functions' | ||||||
import { getFullUrl } from '~/utils/get-full-url' | ||||||
import { baseService } from './base-service' | ||||||
import { | ||||||
GetUsersParams, | ||||||
UpdateUserParams, | ||||||
|
@@ -25,6 +27,24 @@ export const userService = { | |||||
createUrlPath(URLs.users.get, userId, { role: userRole, isEdit }) | ||||||
) | ||||||
}, | ||||||
|
||||||
getUserByIdWithBaseService: ( | ||||||
id: string, | ||||||
userRole: UserRole, | ||||||
isEdit?: boolean | ||||||
) => { | ||||||
return baseService.request<UserResponse>({ | ||||||
method: 'GET', | ||||||
url: getFullUrl({ | ||||||
pathname: URLs.users.getUserById, | ||||||
parameters: { id }, | ||||||
searchParameters: { | ||||||
role: userRole, | ||||||
isEdit: isEdit !== undefined ? isEdit.toString() : undefined | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw the same in one of your previous PRs, did I missed something?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I forgot to fix it in this PR too, but I'll first merge the previous PR and then do a rebase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to rebase your other branch and then do rebase on this branch. Don't use merge, please |
||||||
} | ||||||
}) | ||||||
}) | ||||||
}, | ||||||
updateUser: ( | ||||||
userId: string, | ||||||
params: UpdateUserParams | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to discuss problems with
useForm
hook on our next daily call, remind me please about it