0
Fork 0
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:
Wang Sijie 2021-11-18 11:26:51 +08:00 committed by GitHub
parent 9c3b67ae46
commit 7d7b8112f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -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;

View file

@ -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),

View file

@ -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,