Unable to make changes to a file authored by a different user within Firestore using Vue.js / Firestore

I appreciate any assistance in advance, as this issue has been causing me a lot of frustration!

Currently, I am adhering to the firestore data model where users are able to create their own documents associated with their userID. This ensures that users can only view and manage requests they have created. However, there is an administrator who needs access to and be able to edit requests submitted by these users.

Up until now, I have managed to access the subcollection using collectionGroup('subcollection'). While it does retrieve the documents, whenever I attempt to update or delete any document (other than those I have created myself as an admin), it throws an uncaught (in promise) FirebaseError: No document to update error.

HTML:

<!-- Add New Request -->
<input
  type="submit"
  @click="addRequest"
  value="Save and Add"  
/>

<!-- Update Past Request -->
<button
  @click="updateRequest()"
  type="button"
  v-if="modal == 'edit'"
  >Update
</button>

<!-- Delete Past Request -->
<button
  @click="deleteRequest(request)"
  type="button"
  v-if="modal == 'edit'"
  >Delete
</button>

<!-- Set return objects -->
data() {
  return {
      requests: [],
      request: {
        //Standard
        req_assigned: null,
        req_contact: null,
        req_status: null,
        timestamp: null
      },
  }
}

<!-- Firestore Assign -->
firestore() {
  const user = fb.auth().currentUser;

  return {
    requests: db.collection("uzers").doc(user.uid).collection("requestz"),
    uzers: db.collection("uzers").doc(user.uid),
    bulksettings: db.collection("bulksettingz")
  };
},

JAVASCRIPT:

// Add New Request 
addRequest() {
  this.$firestore.requests.add(this.request);
}

// Update Past Request
updateRequest() {
  this.$firestore.requests.doc(this.request.id).update(this.request);
},

// Delete Past Request
deleteProduct(doc) {
  this.$firestore.requests.doc(doc.id).delete();
},

THE ERROR:

index.cjs.js?e89a:350 Uncaught (in promise) FirebaseError: No document to update: projects/vue-shop-276c4/databases/(default)/documents/uzers/k0yZFhDbldVpf6FhhPMcykK5GJD3/requestz/9ET8nk53MxBx3JlhZqKx
    at new FirestoreError (webpack-internal:///./node_modules/@firebase/firestore/dist/index.cjs.js:350:28)

In summary, I am facing challenges while trying to modify and remove requests created by other users. Any guidance on resolving this issue would be greatly appreciated.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The jQuery code functions properly only if it is inserted directly into the console

I'm facing an issue with a Mobile Font markup switch function. It works fine in the console, but not when I run it within a document ready function or call the function separately. It's strange that I have to paste the code directly into the con ...

What is the best method for displaying a table using a JSON array?

I have a JSON array that I want to display in a table using React boxes: [ { id: 1, color: "red", size: "small" }, { id: 2, color: "blue", size: "medium" }, { id: 3, color: "green", size: "large" }, { id: 4, color: "yellow" ...

"eliminate" ng-if after the condition becomes true

I'm curious to know if it's possible to deactivate or remove ng-if once its value becomes true? In my project, I've constructed a tree structure using a recursive directive. Each branch in the tree has a <div ng-if="visible"> element ...

Using JavaScript to adjust the width of the table header

I have a table that I need to adjust the width of using JavaScript or jQuery. <div class="dataTables_scrollHeadInner" > <table class="table table-condensed table-bordered table-striped dataTable no-footer" > <thead ...

Ensuring uniqueness in an array using Typescript: allowing only one instance of a value

Is there a simple method to restrict an array to only contain one true value? For instance, if I have the following types: array: { value: boolean; label: string; }[]; I want to make sure that within this array, only one value can be set to t ...

Using VueJS to fetch and display data from a JSON file using

Currently, I am dealing with a JSON value in the following format: { "T1" : "online", "T2" : "offline" } Additionally, I have an online API which only sends me the following response: { StatusCode :"T1" } My task is to extract the code from the API res ...

Learning to dynamically access files from various folders and subfolders within webpack using JavaScript

I'm currently working on a project in VueJs using webpack. As part of this, I need to dynamically include config/routing files from specific folders. Here is an example of my folder structure: plugins |----Ecommerce |--------backend |--------frontend ...

The issue of texpress-session failing to set a cookie in a React application arises when the app is deployed

I'm encountering an issue where I can't establish session cookies in the browser for my MERN stack application. Everything works fine when both the express server and the react front end are running locally, but the problem arises after deploying ...

The continuous firing of the postback event of the Asp.Net Button is

Why does the postback event keep firing for my button? Strangely, when I try to debug with Firebug and set a break point on the function(e) part, the code seems to skip right over it. Even using return false doesn't seem to resolve the issue. <sc ...

Close ui-bootstrap typeahead menu only when a row is manually chosen

I have set up this jsBin to show the problem I am facing. When you visit the link and try to type "Five," the expected behavior would be to type "Five" and then press tab. However, in this case, you need to type "Five" and then either escape or click outsi ...

Error encountered in Storybook: The value is not iterable (property Symbol(Symbol.iterator) cannot be read)

I recently created a React library using and opted for the React + TypeScript + Storybook template. You can find the entire codebase here → https://github.com/deadcoder0904/react-typical I encountered the following error: undefined is not iterable ( ...

Express.js - What is the method to determine the total number of routes set up in my application?

Is there a way to calculate the total number of routes set up in Express.js without manually counting them? I have defined routes throughout my application and they are not grouped together, so I can't use a counter inside each one. I've searche ...

An element in CSS that has a position of fixed and a width of 100% surpasses the dimensions of its

My element has the CSS properties position:fixed and width:100%, causing it to be larger than its parent elements. Despite the complexity of my code, I have attempted to simplify it for better understanding. Below, you can see that the green box exceeds ...

unable to effectively test promises with stubs using nodejs mocha

Currently, I am facing a couple of challenges when attempting to perform unit testing on promises using Mocha. 1) The main issue I encounter is an Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Prom ...

Unable to execute script tag on PHP page loading

When I make an AJAX request to fetch JavaScript wrapped in <script> tags that needs to be inserted on the current page, how can I ensure that the code executes upon insertion? Here's the snippet I'm using to add the code: function display ...

How to use JavaScript and regex to control the state of a disabled submit button

I have a challenge where I need to activate or deactivate a submission button in a form called btn-vote using JavaScript. The button will only be activated if one of the 10 radio buttons is selected. Additionally, if the person-10 radio button is chosen, t ...

Encountering an error when integrating my library with MUI

Currently, I am working on developing a library that wraps MUI. One of the components I created is a Button, and here is the code snippet for it: import React, { ReactNode } from 'react' import Button from '@mui/material/Button'; impor ...

Jquery Mobile: Navigating back to the first page after calling changePage

In the process of developing a mobile app with phonegap/cordova and jquery mobile, I encountered an issue where the user is supposed to land on a specific page from a status bar notification. However, the app initially displays the default page briefly bef ...

Exploring Vue.js with the composition API, delving into the world of "Mixins" and mastering life-cycle hooks

I've been searching everywhere (and coming up empty-handed) for a solution to the following question. In Vue 2.x, I was able to utilize mixins for life-cycle hooks. For example, I could create a file Mixins.js with: export default { created() { ...

Searching for the clicked tr element within a tbody using jQuery

Here is my customized HTML table layout <table> <thead> <tr> <td class="td20"><h3>Client Name</h3></td> <td class="td20"><h3>Details</h3></td> ...