2
0

feat(db): 🗃️ Add createdAt and updatedAt

This commit is contained in:
Baptiste Arnaud
2022-02-24 14:52:35 +01:00
parent b9dafa611e
commit a499d85c98
6 changed files with 54 additions and 18 deletions

View File

@ -24,7 +24,7 @@ export const useCredentials = ({
export const createCredentials = async (
userId: string,
credentials: Omit<Credentials, 'ownerId' | 'id' | 'iv'>
credentials: Omit<Credentials, 'ownerId' | 'id' | 'iv' | 'createdAt'>
) =>
sendRequest<{
credentials: Credentials

View File

@ -12,7 +12,7 @@ export const useCustomDomains = ({
onError: (error: Error) => void
}) => {
const { data, error, mutate } = useSWR<
{ customDomains: CustomDomain[] },
{ customDomains: Omit<CustomDomain, 'createdAt'>[] },
Error
>(userId ? `/api/users/${userId}/customDomains` : null, fetcher)
if (error) onError(error)
@ -25,7 +25,7 @@ export const useCustomDomains = ({
export const createCustomDomain = async (
userId: string,
customDomain: Omit<CustomDomain, 'ownerId'>
customDomain: Omit<CustomDomain, 'ownerId' | 'createdAt'>
) =>
sendRequest<{
credentials: Credentials