mirror of
https://github.com/immich-app/immich
synced 2025-06-09 04:38:04 +00:00

* Refactor main index page * Refactor admin page * Refactor Auth endpoint * Refactor directory to prep for monorepo * Fixed refactoring path * Resolved file path in vite * Refactor photo index page * Refactor thumbnail * Fixed test * Refactor Video Viewer component * Refactor download file * Refactor navigation bar * Refactor upload file check * Simplify Upload Asset signature * PR feedback
35 lines
739 B
TypeScript
35 lines
739 B
TypeScript
import type { RequestHandler } from '@sveltejs/kit';
|
|
import { api } from '@api';
|
|
|
|
export const post: RequestHandler = async ({ request }) => {
|
|
const form = await request.formData();
|
|
|
|
const email = form.get('email');
|
|
const password = form.get('password');
|
|
const firstName = form.get('firstName');
|
|
const lastName = form.get('lastName');
|
|
|
|
const { status } = await api.userApi.createUser({
|
|
email: String(email),
|
|
password: String(password),
|
|
firstName: String(firstName),
|
|
lastName: String(lastName),
|
|
});
|
|
|
|
if (status === 201) {
|
|
return {
|
|
status: 201,
|
|
body: {
|
|
success: 'Succesfully create user account',
|
|
},
|
|
};
|
|
} else {
|
|
return {
|
|
status: 400,
|
|
body: {
|
|
error: 'Error create user account',
|
|
},
|
|
};
|
|
}
|
|
};
|