Skip to content

Commit

Permalink
add check to canDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
NyaomiDEV committed May 7, 2024
1 parent f238814 commit 2633aec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/components/MemberInList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
import { Member, getTable } from '../lib/db/entities/members';
import { getBlobURL } from '../lib/util/blob';
const { member } = defineProps<{
member: Member
const { member, canDelete } = defineProps<{
member: Member,
canDelete: boolean
}>();
async function removeFromDatabase() {
Expand All @@ -30,7 +31,7 @@
<!-- TODO: Add tags as chips -> @mecha-cat -->
</IonItem>
<IonItemOptions>
<IonItemOption color="danger" @click="removeFromDatabase()">Delete</IonItemOption>
<IonItemOption v-if="canDelete" color="danger" @click="removeFromDatabase()">Delete</IonItemOption>
</IonItemOptions>
</IonItemSliding>
</template>
2 changes: 1 addition & 1 deletion src/views/tabbed/Members.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
TODO: Member add/edit modal. If you want to test this view, add a member through Testing Grounds
</IonLabel>

<MemberInList v-for="member in members" :member />
<MemberInList v-for="member in members" :member :canDelete="true" />
</IonList>
</IonContent>
</IonPage>
Expand Down

0 comments on commit 2633aec

Please sign in to comment.