specify return type of createAccount
This commit is contained in:
parent
6c05e1d2af
commit
7b38fd582c
@ -1,6 +1,6 @@
|
|||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { createInventory } from "@/src/services/inventoryService";
|
import { createInventory } from "@/src/services/inventoryService";
|
||||||
import { IDatabaseAccount } from "@/src/types/loginTypes";
|
import { IDatabaseAccount, IDatabaseAccountDocument } from "@/src/types/loginTypes";
|
||||||
import { createShip } from "./shipService";
|
import { createShip } from "./shipService";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
||||||
@ -12,7 +12,7 @@ export const isCorrectPassword = (requestPassword: string, databasePassword: str
|
|||||||
return requestPassword === databasePassword;
|
return requestPassword === databasePassword;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createAccount = async (accountData: IDatabaseAccount) => {
|
export const createAccount = async (accountData: IDatabaseAccount): Promise<IDatabaseAccountDocument> => {
|
||||||
const account = new Account(accountData);
|
const account = new Account(accountData);
|
||||||
try {
|
try {
|
||||||
await account.save();
|
await account.save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user