mirror of
https://github.com/logto-io/logto.git
synced 2025-04-07 23:01:25 -05:00
refactor(core): use plural in endpoint (#134)
This commit is contained in:
parent
9c3b67ae46
commit
7d7b8112f6
3 changed files with 6 additions and 6 deletions
|
@ -23,7 +23,7 @@ export default function applicationRoutes<T extends AuthedRouter>(router: T) {
|
|||
});
|
||||
|
||||
router.post(
|
||||
'/application',
|
||||
'/applications',
|
||||
koaGuard({
|
||||
body: Applications.guard
|
||||
.omit({ id: true, createdAt: true })
|
||||
|
@ -45,7 +45,7 @@ export default function applicationRoutes<T extends AuthedRouter>(router: T) {
|
|||
);
|
||||
|
||||
router.get(
|
||||
'/application/:id',
|
||||
'/applications/:id',
|
||||
koaGuard({
|
||||
params: object({ id: string().min(1) }),
|
||||
}),
|
||||
|
@ -60,7 +60,7 @@ export default function applicationRoutes<T extends AuthedRouter>(router: T) {
|
|||
);
|
||||
|
||||
router.patch(
|
||||
'/application/:id',
|
||||
'/applications/:id',
|
||||
koaGuard({
|
||||
params: object({ id: string().min(1) }),
|
||||
body: Applications.guard.omit({ id: true, createdAt: true }).partial(),
|
||||
|
@ -84,7 +84,7 @@ export default function applicationRoutes<T extends AuthedRouter>(router: T) {
|
|||
);
|
||||
|
||||
router.delete(
|
||||
'/application/:id',
|
||||
'/applications/:id',
|
||||
koaGuard({ params: object({ id: string().min(1) }) }),
|
||||
async (ctx, next) => {
|
||||
const { id } = ctx.guard.params;
|
||||
|
|
|
@ -21,7 +21,7 @@ import { AnonymousRouter } from './types';
|
|||
|
||||
export default function userRoutes<T extends AnonymousRouter>(router: T, provider: Provider) {
|
||||
router.post(
|
||||
'/user',
|
||||
'/users',
|
||||
koaGuard({
|
||||
body: object({
|
||||
username: string().min(3),
|
||||
|
|
|
@ -5,7 +5,7 @@ export const register = async (username: string, password: string) => {
|
|||
redirectTo: string;
|
||||
};
|
||||
return ky
|
||||
.post('/api/user', {
|
||||
.post('/api/users', {
|
||||
json: {
|
||||
username,
|
||||
password,
|
||||
|
|
Loading…
Add table
Reference in a new issue