-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
188 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> | ||
|
||
type BaseUser = { | ||
dni: number | ||
viajes: number | ||
} | ||
|
||
type BasePrices = { | ||
viajePrice: number | ||
pasePrice: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
module.exports = { | ||
typeDefs: // Code generated by Prisma ([email protected]). DO NOT EDIT. | ||
// Code generated by Prisma ([email protected]). DO NOT EDIT. | ||
// Please don't change this file manually but run `prisma generate` to update it. | ||
// For more information, please read the docs: https://www.prisma.io/docs/prisma-client/ | ||
|
||
/* GraphQL */ `type AggregateLog { | ||
export const typeDefs = /* GraphQL */ `type AggregateLog { | ||
count: Int! | ||
} | ||
|
@@ -474,6 +473,4 @@ input UserWhereUniqueInput { | |
uid: String | ||
dni: Int | ||
} | ||
` | ||
} | ||
|
||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { text } from 'micro' | ||
import { prisma } from 'prisma' | ||
import { IncomingMessage, OutgoingMessage } from 'http' | ||
|
||
export default async (req: IncomingMessage, res: OutgoingMessage) => { | ||
try { | ||
if (req.headers.secret !== process.env.SECRET) throw 'error!' | ||
const uid = await text(req) | ||
|
||
let user = await prisma.user({ uid }) | ||
if (!user) throw 'error!' | ||
|
||
const metadata = await prisma.metadatas({ | ||
orderBy: 'date_ASC', | ||
last: 1, | ||
}) | ||
|
||
res.end(`res:${user.viajes}-${metadata[0].viajePrice}!`) | ||
} catch (error) { | ||
res.end(error) | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
web/src/pages/api/graphql/resolvers.js → web/src/pages/api/graphql/resolvers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.