added lastLogin to publishers

This commit is contained in:
Dobromir Popov
2024-04-25 19:51:13 +03:00
parent d28b82b1fa
commit 2fb9dc3803
6 changed files with 48 additions and 36 deletions

View File

@ -39,6 +39,7 @@ function ContactsPage({ publishers, allPublishers }) {
<th className="border-b font-medium p-4 pl-8 pt-0 pb-3">Име</th>
<th className="border-b font-medium p-4 pt-0 pb-3">Възможности</th>
<th className="border-b font-medium p-4 pt-0 pb-3">Участия</th>
<th className="border-b font-medium p-4 pt-0 pb-3">Последно влизане</th>
</tr>
</thead>
<tbody>
@ -67,6 +68,7 @@ function ContactsPage({ publishers, allPublishers }) {
</div>
</div>
</td>
<td className="border-b p-4">{pub.lastLogin ? common.getDateFormated(pub.lastLogin) : ""}</td>
</>
) : (
<>
@ -125,7 +127,7 @@ export const getServerSideProps = async (context) => {
const prisma = common.getPrismaClient();
const dateStr = new Date().toISOString().split('T')[0];
let publishers = await data.filterPublishersNew('id,firstName,lastName,email,isActive,desiredShiftsPerMonth', dateStr, false, true, true);
let publishers = await data.filterPublishersNew('id,firstName,lastName,email,isActive,desiredShiftsPerMonth,lastLogin', dateStr, false, true, true);
// const axios = await axiosServer(context);
// const { data: publishers } = await axios.get(`api/?action=filterPublishers&assignments=true&availabilities=true&date=${dateStr}&select=id,firstName,lastName,isActive,desiredShiftsPerMonth`);
@ -175,6 +177,7 @@ export const getServerSideProps = async (context) => {
phone: true,
isActive: true,
desiredShiftsPerMonth: true,
lastLogin: true,
assignments: {
select: {
id: true,