forked from PolarisPyra/daphnis
added comments
This commit is contained in:
parent
ac02b7b901
commit
fbf5033b36
@ -13,7 +13,7 @@ type chunithm = chuni_score_playlog &
|
|||||||
export default async function Share({
|
export default async function Share({
|
||||||
params,
|
params,
|
||||||
}: {
|
}: {
|
||||||
// pass the token and playlog id as params
|
// pass the token and playlog id as params www.www.com/generatedtoken/playlogid
|
||||||
params: { token: string; id: string };
|
params: { token: string; id: string };
|
||||||
}) {
|
}) {
|
||||||
const { token, id } = params;
|
const { token, id } = params;
|
||||||
|
@ -25,9 +25,9 @@ export async function generateShareToken(id: number): Promise<{
|
|||||||
const token = await daphnis.linkSharingToken.create({
|
const token = await daphnis.linkSharingToken.create({
|
||||||
data: {
|
data: {
|
||||||
playlogId: id, // sets the playlog id
|
playlogId: id, // sets the playlog id
|
||||||
id: randomUUID(), // generates a random share id
|
id: randomUUID(), // generates a random primary id for the share token
|
||||||
userId: user.id, // attaches the userid
|
userId: user.id, // attaches the userid from daphnis
|
||||||
token: gernatetoken, // makes an expirable token
|
token: gernatetoken, // makes an expirable token thats added to the token column
|
||||||
createdAt: new Date(), // created at date
|
createdAt: new Date(), // created at date
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user