mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-04-11 05:19:04 +02:00
Change isAdmin to hasPaid
This commit is contained in:
parent
5d97b8771a
commit
db804c05ff
@ -330,8 +330,8 @@ action updateCurrentUserLastActiveTimestamp {
|
||||
entities: [User]
|
||||
}
|
||||
|
||||
action updateIsUserAdminById {
|
||||
fn: import { updateIsUserAdminById } from "@src/server/actions.js",
|
||||
action updateHasPaidByUserId {
|
||||
fn: import { updateHasPaidByUserId } from "@src/server/actions.js",
|
||||
entities: [User]
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { updateIsUserAdminById, useQuery, getPaginatedUsers } from 'wasp/client/operations';
|
||||
import { updateHasPaidByUserId, useQuery, getPaginatedUsers } from 'wasp/client/operations';
|
||||
import { useState, useEffect } from 'react';
|
||||
import SwitcherOne from './SwitcherOne';
|
||||
import Loader from '../common/Loader';
|
||||
@ -218,7 +218,7 @@ const UsersTable = () => {
|
||||
</div>
|
||||
<div className='col-span-1 flex items-center'>
|
||||
<div className='text-sm text-black dark:text-white'>
|
||||
<SwitcherOne user={user} updateUserById={updateIsUserAdminById} />
|
||||
<SwitcherOne user={user} updateUserById={updateHasPaidByUserId} />
|
||||
</div>
|
||||
</div>
|
||||
<div className='col-span-1 flex items-center'>
|
||||
|
@ -4,7 +4,7 @@ import {
|
||||
type GenerateGptResponse,
|
||||
type StripePayment,
|
||||
type UpdateCurrentUserLastActiveTimestamp,
|
||||
type UpdateIsUserAdminById,
|
||||
type UpdateHasPaidByUserId,
|
||||
type CreateTask,
|
||||
type DeleteTask,
|
||||
type UpdateTask,
|
||||
@ -275,7 +275,7 @@ export const deleteTask: DeleteTask<Pick<Task, 'id'>, Task> = async ({ id }, con
|
||||
return task;
|
||||
};
|
||||
|
||||
export const updateIsUserAdminById: UpdateIsUserAdminById<{ id: number; data: Pick<User, 'isAdmin'> }, User> = async (
|
||||
export const updateHasPaidByUserId: UpdateHasPaidByUserId<{ id: number; data: Pick<User, 'hasPaid'> }, User> = async (
|
||||
{ id, data },
|
||||
context
|
||||
) => {
|
||||
@ -290,7 +290,7 @@ export const updateIsUserAdminById: UpdateIsUserAdminById<{ id: number; data: Pi
|
||||
id,
|
||||
},
|
||||
data: {
|
||||
isAdmin: data.isAdmin,
|
||||
isAdmin: data.hasPaid,
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user