made playlog table dynamic

This commit is contained in:
polaris
2024-06-29 14:43:11 -04:00
parent 30825e20f1
commit c784e8808e
14 changed files with 218 additions and 46 deletions

View File

@ -1,12 +1,10 @@
import ChunithmData from "@/components/scoreplaylog/page";
import React from "react";
import ChunithmData from "../../../components/scoreplaylog/page";
const ChunithmPage = async () => {
return (
<div>
<div className=" ">
<ChunithmData />
</div>
</div>
);
};

View File

@ -1,3 +1,4 @@
import { getAuth } from "@/auth/queries/getauth";
import { generatePlaylogId, getSongsWithTitles } from "@/lib/api";
import { shareScore } from "../token";
@ -16,7 +17,17 @@ export default async function Share({
return <p>{tokenResult.error}</p>;
}
const userId = 10000;
const { user } = await getAuth();
if (!user?.UserId) {
return {
error:"no user id"
}
}
const userId = user?.UserId;
const playlogId = parseInt(id);
const songsData = await getSongsWithTitles(userId);